1
0
mirror of https://github.com/golang/go synced 2024-09-30 16:28:32 -06:00
go/cmd/stringer
Roger Peppe 63e6ed9258 cmd/stringer: compile error when constants change
When constant values change but stringer has not
been run again, we can get misleading string values.
Protect against this by generating code that will fail
with a compiler error when this happens.
Most compilers should be smart enough to omit the
code containing the checks.

Change-Id: I7a36d20f014cba0e7d88851d1b649a098ee30d76
Reviewed-on: https://go-review.googlesource.com/c/tools/+/163637
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
2019-03-18 00:52:22 +00:00
..
testdata cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00
endtoend_test.go cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00
golden_test.go cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00
stringer.go cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00
util_test.go cmd/stringer: compile error when constants change 2019-03-18 00:52:22 +00:00