- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for nameToConcreteType (0.39 sec)
-
src/encoding/gob/type_test.go
}{ {&N1{}, "*gob.N1"}, {N2{}, "encoding/gob.N2"}, } for _, tc := range testCases { Register(tc.t) tct := reflect.TypeOf(tc.t) ct, _ := nameToConcreteType.Load(tc.name) if ct != tct { t.Errorf("nameToConcreteType[%q] = %v, want %v", tc.name, ct, tct) } // concreteTypeToName is keyed off the base type. if tct.Kind() == reflect.Pointer { tct = tct.Elem() }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 01 14:26:13 UTC 2023 - 6.1K bytes - Viewed (0) -
src/encoding/gob/type.go
if t, dup := nameToConcreteType.LoadOrStore(name, reflect.TypeOf(value)); dup && t != ut.user { panic(fmt.Sprintf("gob: registering duplicate types for %q: %s != %s", name, t, ut.user)) } // but the flattened type in the type table, since that's what decode needs. if n, dup := concreteTypeToName.LoadOrStore(ut.base, name); dup && n != name { nameToConcreteType.Delete(name)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 02:00:26 UTC 2024 - 27.2K bytes - Viewed (0) -
src/encoding/gob/decode.go
value.SetZero() return } if len(name) > 1024 { errorf("name too long (%d bytes): %.20q...", len(name), name) } // The concrete type must be registered. typi, ok := nameToConcreteType.Load(string(name)) if !ok { errorf("name not registered for interface: %q", name) } typ := typi.(reflect.Type) // Read the type id of the concrete value. concreteId := dec.decodeTypeSequence(true)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Sep 07 19:10:23 UTC 2023 - 40.1K bytes - Viewed (0)