Documentation ¶
Overview ¶
This library allow to define a default value to any struct, this is made thanks to struct tags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaults ¶
func SetDefaults(variable interface{})
Applies the default values to the struct object, the struct type must have the StructTag with name "default" and the directed value.
Usage
type ExampleBasic struct { Foo bool `default:"true"` Bar string `default:"33"` Qux int8 } foo := &ExampleBasic{} SetDefaults(foo)
Types ¶
Click to show internal directories.
Click to hide internal directories.