9 "github.com/zclconf/go-cty/cty/set"
12 // InternalTypesToRegister is a slice of values that covers all of the
13 // internal types used in the representation of cty.Type and cty.Value
14 // across all cty Types.
16 // This is intended to be used to register these types with encoding
17 // packages that require registration of types used in interfaces, such as
18 // encoding/gob, thus allowing cty types and values to be included in streams
19 // created from those packages. However, registering with gob is not necessary
20 // since that is done automatically as a side-effect of importing this package.
22 // Callers should not do anything with the values here except pass them on
23 // verbatim to a registration function.
25 // If the calling application uses Capsule types that wrap local structs either
26 // directly or indirectly, these structs may also need to be registered in
27 // order to support encoding and decoding of values of these types. That is the
28 // responsibility of the calling application.
29 var InternalTypesToRegister []interface{}
32 InternalTypesToRegister = []interface{}{
44 map[string]interface{}(nil),
47 // Register these with gob here, rather than in gob.go, to ensure
48 // that this will always happen after we build the above.
49 for _, tv := range InternalTypesToRegister {
50 typeName := fmt.Sprintf("%T", tv)
51 if strings.HasPrefix(typeName, "cty.") {
52 gob.RegisterName(fmt.Sprintf("github.com/zclconf/go-cty/%s", typeName), tv)