Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
Merge make new struct value with the exported fields of the given structs. If some have a same name of field, the field of the last struct in the parameters is used. If non struct value is in the parameters, it would be ignored.
type A { N int `json:"n"`} type B { S string `json:"s"`} /* struct{ N int `json:"n"` S string `json:"s"` }{ N: 100, S: "sample", } */ Merge(A{N:100}, B{S:"sample"})
func Of ¶
Of make new struct value with the given names, values and tags as fields.
/* struct{ N int S string }{ N: 100, S: "sample", } */ Of(F("N", 100), F("S", "sample")) /* struct{ N int `json:"n"` S string `json:"s"` }{ N: 100, S: "sample", } */ Of(F("N", 100, Tag(`json:"n"`)), F("S", "sample", Tag(`json:"s"`)))
The tags can be ommited.
Types ¶
type FieldOption ¶
type FieldOption func(*Field)
Click to show internal directories.
Click to hide internal directories.