Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(val interface{}) error
Apply apply the defaults values defined in the field tags. Currently the supported types are int, int32, int64, float32, float64, string, bool If the value is different of one these types the function returns an error.
The function expects a pointer to a struct.
Eg.
type testStruct struct { AString string `default:"Claudemiro"` AInt int `default:"27"` AInt32 int32 `default:"28"` AInt64 int64 `default:"29"` AFloat32 float32 `default:"3.1415"` AFloat64 float64 `default:"3.1415"` ABoolean bool `default:"true"` NotAnnotated float64 }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.