x/tools/cmd/stringer: redundant check #36461
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This issue reproduces using
x/tools/cmd/stringer
on the latest from master (b9c20ae
).What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran
x/tools/cmd/stringer
on the following file: https://play.golang.org/p/H5tvJ6EdhrrWhat did you expect to see?
stringer
's output can be grouped into four categories based on the type being "stringed":Using the above playground example:
String
method includes a check fori < 0
:String
method does not include this check:I would expect to see the same logic for the signed/unsigned multiple runs cases.
What did you see instead?
Instead, the unsigned / multiple run case includes a redundant check for
0 <= i
in itsString
method.Using the above playground example:
The text was updated successfully, but these errors were encountered: