Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/csutorasa/gombok
Go code generation library
https://github.com/csutorasa/gombok
Last synced: about 2 months ago
JSON representation
Go code generation library
- Host: GitHub
- URL: https://github.com/csutorasa/gombok
- Owner: csutorasa
- License: mit
- Created: 2022-01-30T13:00:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-09T16:34:45.000Z (12 months ago)
- Last Synced: 2024-06-21T13:11:20.418Z (7 months ago)
- Language: Go
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gombok
Gombok is a go code generation library inspired by [Project Lombok](https://projectlombok.org/).
## How to install
Install go version 1.18 or newer.
You can downgrade to 1.13 but cannot use generics [here](https://github.com/csutorasa/gombok/tree/1.13).
Install the generator with the following command:
```bash
go install github.com/csutorasa/[email protected]
```## How to use
For command line options you may run `gombok -h`.
Enable default generation:
```go
//go:generate gombok
```This enables processing all files in the project. To disable processing for specific files you can add:
```go
//go:gombok ignore
```All generated files have this ignore flag.
You can add the gombok comments or tags to enable code generation.
```go
//go:gombok Stringer
type Example struct {
//go:gombok Getter
firstname string
lastname string `gombokSetter:""`
}
```## Available generators
- [Builder](docs/builder.md)
- [Constructor](docs/constructor.md)
- [Destructor](docs/destructor.md)
- [Getter](docs/getter.md)
- [Setter](docs/setter.md)
- [Stringer](docs/stringer.md)
- [Wither](docs/wither.md)