Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 509 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 509 Bytes

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 ./...