The goal of this module is to provide a simple way to associate a behavior with the tag of a Go struct.
type Config struct {
Foo struct {
Bar string `oneActionTag:"dev"`
}
Age int `anotherActionTag:"42"`
}
func TestXxx(t *testing.T) {
var config Config
Browse(&config,
WithTagFn("oneActionTag", oneActionTag),
WithTagFn("anotherActionTag", anotherActionTag),
)
}
func oneActionTag(tagContent string, field FieldIf) error {
// do some stuffs
return nil
}
func anotherActionTag(tagContent string, field FieldIf) error {
// do some stuffs
return nil
}Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is open source and available under the MIT License.