Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

6 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages