Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeySlice ¶
func KeySlice[M ~map[K]V, K comparable, V any](m M) []K
KeySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)).
Types ¶
type JSONInfo ¶
type JSONInfo struct { Omit bool // unexported or first tag element is "-" Name string // Go field name or first tag element. Empty if Omit is true. Settings map[string]bool // "omitempty", "omitzero", etc. }
func FieldJSONInfo ¶
func FieldJSONInfo(f reflect.StructField) JSONInfo
FieldJSONInfo reports information about how encoding/json handles the given struct field. If the field is unexported, JSONInfo.Omit is true and no other JSONInfo field is populated. If the field is exported and has no tag, then Name is the field's name and all other fields are false. Otherwise, the information is obtained from the tag.
Click to show internal directories.
Click to hide internal directories.