aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/type.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2017-11-12 16:55:11 +0000
committerRobert Griesemer <gri@golang.org>2017-11-13 00:35:25 +0000
commit6e9960ea632cae58e6f8f494876f45fe05cc10b6 (patch)
tree57346937143a7bedc3440359b4a7e862e963f304 /src/cmd/compile/internal/types/type.go
parent79dbc1cc7b029e9f2e45cc9d7796151bd90b224a (diff)
downloadgo-6e9960ea632cae58e6f8f494876f45fe05cc10b6.tar.gz
go-6e9960ea632cae58e6f8f494876f45fe05cc10b6.zip
cmd/compile: use stringer on types.EType
Another one that is possible thanks to the new -trimprefix stringer flag. The only subtle difference is that, in the previous version, some values such as TUNSAFEPTR were stringified as "TUNSAFEPTR" instead of "UNSAFEPTR". The new String method is always consistent in removing the "T" prefix. Passes toolstash -cmp on std cmd. Change-Id: I68407f391795403dfcbbfa68c813018c0235bbb5 Reviewed-on: https://go-review.googlesource.com/77250 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Marvin Stenger <marvin.stenger94@gmail.com> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types/type.go')
-rw-r--r--src/cmd/compile/internal/types/type.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go
index 44cdabcb30..e62d324cde 100644
--- a/src/cmd/compile/internal/types/type.go
+++ b/src/cmd/compile/internal/types/type.go
@@ -15,11 +15,13 @@ import (
// TODO(gri) try to eliminate soon
type Node struct{ _ int }
+//go:generate stringer -type EType -trimprefix T
+
// EType describes a kind of type.
type EType uint8
const (
- Txxx = iota
+ Txxx EType = iota
TINT8
TUINT8