tags

package
v0.0.0-...-3cdd3a9 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(o Options) error

Generate generates tags according to the given options.

Types

type Options

type Options struct {
	// Target is the file or directory to parse, or current dir if empty.
	Target string
	// Tags contains schema names like json or yaml.
	Tags []string
	// Template is used to generate the contents of the struct tag field if Tags is empty.
	Template *template.Template
	// Mapping contains field name conversions. If a field isn't in the map, lowercase of field name is used.
	Mapping map[string]string
	// Types to generate tags for, if empty, all structs will have tags generated.
	Types []string
	// DryRun indicates whether we should simply write to StdOut rather than writing to the files.
	DryRun bool

	AppendMod bool
}

Options contains the data needed to generate tags for a target (file or package).

Jump to

Keyboard shortcuts

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