Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

rickb777/stringer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stringer

Travis CI status

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/rickb777/stringer

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

  • Go 100.0%