Help us shape the future of Go! Take the 2026 Go Developer Survey

gog

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: BSD-2-Clause

README

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)

Directories

Path Synopsis
cmd
gog command
Code generated by gog; DO NOT EDIT.
Code generated by gog; DO NOT EDIT.
Code generated by gog; DO NOT EDIT.
Code generated by gog; DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL