https://github.com/josestg/go-getter
go-getter is a tool to generate getter methods for struct fields.
https://github.com/josestg/go-getter
codegen getter go-getter
Last synced: about 1 month ago
JSON representation
go-getter is a tool to generate getter methods for struct fields.
- Host: GitHub
- URL: https://github.com/josestg/go-getter
- Owner: josestg
- License: mit
- Created: 2024-02-06T14:32:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-06T14:48:55.000Z (about 1 year ago)
- Last Synced: 2025-01-31T06:47:04.617Z (3 months ago)
- Topics: codegen, getter, go-getter
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-getter
go-getter is a tool to generate getter methods for struct fields.
## Install
```shell
go install github.com/josestg/go-getter@latest
```## Example
```shell
go-getter -typ User -src examples/user.go -out examples/user.gen.go -ptr=false
```or using `go:generate` directive
```go
// Path: examples/todo.gopackage examples
//go:generate go-getter -typ Todo -src $GOFILE -out ./todo.gen.go
type Todo struct {
title string
completed bool
}
``````shell
go generate ./...
```