-
-
Notifications
You must be signed in to change notification settings - Fork 79
Description
gocty was written quite early on when maps and objects were thought of as very distinct ideas with different operations.
In the meantime, we've blurred that a little by allowing some of the collection operations to also work for object types, since that tends to be more convenient for calling applications that can therefore share code between the two.
Currently the gocty logic is quite picky about the distinction between these, requiring that objects be decoded into structs and maps be decoded into maps. It would be helpful to callers, and more consistent with how the main cty has evolved, to allow decoding objects into Go maps (as long as the attributes all conform to the Go element type) and to allow decoding maps into Go structs, where compatible.