enumer icon indicating copy to clipboard operation
enumer copied to clipboard

[Feature request] Add an option to generate a GoString method

Open theclapp opened this issue 4 months ago • 0 comments

kr/pretty wants a type to implement fmt.GoStringer, so I had to wrap enumer's String, e.g.

func (x MyType) GoString() string  { return x.String() }

It'd be nice if enumer could generate that for me. Obviously for any given type it's not that big a deal, but so far I have three.

Other libraries might want some other interface, so maybe the option could specify the method name, e.g. -otherString=GoString, which you could specify multiple times. Or it could accept a CSV.

theclapp avatar Oct 11 '24 18:10 theclapp