Skip to content

SylvainDumas/stag

Repository files navigation

stag

Build Status Coverage License: MIT

The goal of this module is to provide a simple way to associate a behavior with the tag of a Go struct.

Tech Stack

How to use

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
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is open source and available under the MIT License.

About

Module to permit smooth struct tag management

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Contributors