1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:44:43 -07:00
go/cmd/stringer
Adam Williams 9dc88fb721 cmd/stringer: remove redundant check in generated code
In a certain case, stringer would generate the following check for an
an unsigned integer i: "0 <= i". This changes stringer to not generate
such a check.

Also adds an additional test case for an unsigned multiple run that does
not include zero. There was already a case ("unum") that included an
unsigned multiple run starting at zero. This case's output was updated
accordingly.

Fixes golang/go#36461

Change-Id: I57e79384a0b802fa4571e2b3495db168b814bcaa
Reviewed-on: https://go-review.googlesource.com/c/tools/+/214180
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2020-01-14 01:55:19 +00:00
..
testdata cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00
endtoend_test.go all: skip tests if required tools are not found 2019-08-30 15:40:57 +00:00
golden_test.go cmd/stringer: remove redundant check in generated code 2020-01-14 01:55:19 +00:00
stringer.go cmd/stringer: remove redundant check in generated code 2020-01-14 01:55:19 +00:00
util_test.go cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00