FWIW, this is how I'd deal with the motivating issue around RecordConfig{} 
and mostly-nil Metadata maps:

https://go.dev/play/p/PAMyQ8KG6v9

By making metadata a private member of the struct, you can only access it 
from outside the package via method Metadata() [which will allocate it if 
required] and MetadataReadonly() [which is allowed to return nil]

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/ad276912-6c46-46a2-b68a-22ffb6c3e81en%40googlegroups.com.

Reply via email to