gogen-optiontype

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 6 Imported by: 0

README

gogen-optiontype

Option types (also known as maybe types) for Go programming language, via go generate.

Usage

package itemid

//go:generate gogen-optiontype --pkg=itemid --type=int64

package thingid

//go:generate gogen-optiontype --pkg=thingid --type=string --one-file

package productid

//go:generate gogen-optiontype --pkg=thingid --type=string --one-file --no-tests

And then run:

go generate

or:

gb generate

(If you are using GB.)

Can then use with code similar to:

type Struct Product {
	ID     productid.Type
	Name   string
	ItemID itemid.NullableType
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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