gog
code generation for Go (WIP)
generates:
- Builder -
gog:builder
- Getters -
gog:getter
- AllArgsContructor -
gog:allArgsContructor
- RequiredArgsContructor -
gog:requiredArgsContructor
- Value Objects -
gog:value
Instalation
go get -u github.com/quintans/gog/cmd/gog
Guide
Tag your struct, with the generator tag and then execute gog.
Running gog -r will recursively scan the directories looking for go code with a recognizable tag.
a source file named src.go with
//gog:getter
type Foo struct {
name string
}
will generate a file src.gog.go with
//gog:getter
func (t Foo) Name() string {
return t.name
}
(see the gog_test.go for more examples)