option-gen

command
v0.0.0-...-392fa8f Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

option-gen is a tool for auto-generating with struct field functions.

option-gen can be generated for individual types, rather than the entire package by specifying a comment on the type or filed definition of the form:

// +gen:option=true

You can not participate in the generation by setting the field a comment on the type definition of the form:

// +gen:option=true
type Struct struct {
	// +option=false
	Field string
}

You can also specify the field name that needs to be generated a comment on the type definition of the form:

// +gen:option:fields=field1,field2,field3

Option names and suffixes can be customized by setting the field a comment on the type definition of the form:

// +gen:option:name=StructOptionName

// +gen:option:suffix=StructOptionNameSuffix

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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