Skip to content

Vivalldi/muster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Muster

A golang tool to automate the creation of Must funcs

Go Reference

Usage/Examples

Given this snippet,

package person

func DoGood(name str) error {
	return errors.New("bad")
}

running this command

muster -func=DoGood

in the same directory will create the file dogood_must.go, in package person, containing a definition of

func MustDoGood(name string)

That method will panic if the result of DoGood is not nil.

Go Generate

Add this snipet in a file to use with go generate

//go:generate muster -func=DoGood