Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/cmd/stringer: support for upper / lower / title case #38229

Closed
maltegrosse opened this issue Apr 3, 2020 · 1 comment
Closed

x/tools/cmd/stringer: support for upper / lower / title case #38229

maltegrosse opened this issue Apr 3, 2020 · 1 comment
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@maltegrosse
Copy link

maltegrosse commented Apr 3, 2020

Hi Everybody,

it would be great to have stringer works with different case styles like
-case=toUpper
-case=toLower
-case=title
using the strings function
https://golang.org/pkg/strings/#ToUpper
https://golang.org/pkg/strings/#ToLower
https://golang.org/pkg/strings/#Title
(also in combination with "trim-prefix")

What version of Go are you using (go version)?

$ go version 1.13

Does this issue reproduce with the latest release?

Feature Request, yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
...
set GOHOSTARCH=amd64
set GOHOSTOS=windows
...

What did you do?

type SomeType uint32
go:generate stringer -type=SomeType -trimprefix=SomeType
const (
SomeTypeZero SomeType  = 0
SomeTypeOne SomeType  = 1
SomeTypeTwo SomeType  = 2
)

What did you expect to see?

fmt.println(SomeTypeZero ) --> "zero" or "ZERO" 

What did you see instead?

"Zero" 
@gopherbot gopherbot added this to the Unreleased milestone Apr 3, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Apr 3, 2020
@andybons andybons changed the title x/tools/cmd/stringer feature request: stringer support for uppercase / lowercase x/tools/cmd/stringer: support for upper / lower / title case Apr 3, 2020
@andybons
Copy link
Member

andybons commented Apr 3, 2020

Thanks for the issue.

It’s difficult to know the exact behavior you want because you don’t provide example code or shell output.

That said, cmd/stringer is considered feature complete and no work aside from bug fixes will likely be done on it. You can easily fork it to support your use-case, however.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants