gogetter

command module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

gogetter

Like Getter functions of generated protobuf code? You can simply create yours

Installation

go install github.com/rolandhawk/gogetter@v0.0.1

Usage

//go:generate gogetter StructName1 StructName2

Flags:

Name Default Description
out {source}_getter.go Custom output file name. Format: *.go. Default: {source}_getter.go
dry false Dry run. If true, it will print the output to stdout instead of write to file.

See example for actual use.

Limitation

Currently gogetter is not smart enough to know underlying type of named type. So it will always assume underlying type of named type is struct. It become a problem because gogetter will generate wrong zero value for the getter method. For now, you can work around this problem by specifying custom zero value map using -custom flag options.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package ast contains multiple functions that ease Golang Abstract Syntax Tree manipulation.
Package ast contains multiple functions that ease Golang Abstract Syntax Tree manipulation.
Package example is generated by gogetter.
Package example is generated by gogetter.

Jump to

Keyboard shortcuts

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