Help us shape the future of Go! Take the 2026 Go Developer Survey

optional

command
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Optional is a tool that generates 'optional' type wrappers around a given type T.

Typically this process would be run using go generate, like this:

//go:generate optional -type=Foo

running this command

optional -type=Foo

in the same directory will create the file optional_foo.go containing a definition of

type OptionalFoo struct {
	...
}

The default type is OptionalT or optionalT (depending on if the type is exported) and output file is optional_t.go. This can be overridden with the -output flag.

Jump to

Keyboard shortcuts

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