You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the name of a (signed or unsigned) integer type T that has constants
defined, stringer will create a new self-contained Go source file implementing
func (t T) String() string
That method will translate the value of a Pill constant to the string representation
of the respective constant name, so that the call fmt.Print(painkiller.Aspirin) will
print the string "Aspirin".
I need to pass the string representation from command line and get the corresponding integer value of type T.
EG, giving an input string "Aspirin", I need a method to get the corresponding value of Aspirin (1).
It is not possible at the moment right? Hope it'll be some day.
And meanwhile, while waiting, what shall I do? Can I still make use of the automatic created methods / code, or I should be looking for something entirely different?
Thanks
The text was updated successfully, but these errors were encountered:
gopherbot
added
the
Tools
This label describes issues relating to any tools in the x/tools repository.
label
May 16, 2023
What version of Go are you using (
go version
)?What did you want?
I need to pass the string representation from command line and get the corresponding integer value of type T.
EG, giving an input string "Aspirin", I need a method to get the corresponding value of
Aspirin
(1
).It is not possible at the moment right? Hope it'll be some day.
And meanwhile, while waiting, what shall I do? Can I still make use of the automatic created methods / code, or I should be looking for something entirely different?
Thanks
The text was updated successfully, but these errors were encountered: