/go-getter

go-getter is a tool to generate getter methods for struct fields.

Primary LanguageGoMIT LicenseMIT

go-getter

go-getter is a tool to generate getter methods for struct fields.

Install

go install github.com/josestg/go-getter@latest

Example

go-getter -typ User -src examples/user.go -out examples/user.gen.go -ptr=false

or using go:generate directive

// Path: examples/todo.go

package examples

//go:generate go-getter -typ Todo -src $GOFILE -out ./todo.gen.go
type Todo struct {
    title     string
    completed bool
}
go generate ./...