Skip to content

clipperhouse/stringer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stringer

This is a typewriter package for use with gen, a tool for type-driven code generation. It is a fork of Rob Pike’s tool of the same name, which generates readable strings for consts.

It is one of gen’s built-in typewriters.

To use it:

go get -u github.com/clipperhouse/gen

Then, mark up a type in your package, for example:

// +gen stringer
type Pill int

const (
	Placebo Pill = iota
	Aspirin
	Ibuprofen
	Paracetamol
	Acetaminophen = Paracetamol
)

...and run gen on your package. You should see a new file named mytype_stringer.go. See the gen docs for more information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages