]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet: shorten diagnostic about suspicious struct tag spaces
authorRuss Cox <rsc@golang.org>
Tue, 14 Nov 2017 16:27:03 +0000 (11:27 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 16 Nov 2017 01:07:39 +0000 (01:07 +0000)
Change-Id: I112d0164df6abd9ca1df287376cf3605268385df
Reviewed-on: https://go-review.googlesource.com/78116
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/vet/structtag.go
src/cmd/vet/testdata/structtag.go

index cfa816694e039842f62bddda98fe94f7ea1edba1..3bc30c47405d8f6707adb653617abcba80210317 100644 (file)
@@ -115,7 +115,7 @@ var (
        errTagSyntax      = errors.New("bad syntax for struct tag pair")
        errTagKeySyntax   = errors.New("bad syntax for struct tag key")
        errTagValueSyntax = errors.New("bad syntax for struct tag value")
-       errTagValueSpace  = errors.New("suspicious space found in struct tag value")
+       errTagValueSpace  = errors.New("suspicious space in struct tag value")
        errTagSpace       = errors.New("key:\"value\" pairs not separated by spaces")
 )
 
index 6eec2e3fec24a3ff3c2adbb6973e1d574a8a123c..c87e42f5d004bf1f1249ad53a97c4c734476028c 100644 (file)
@@ -83,19 +83,19 @@ type DuplicateJSONFields struct {
 
 type UnexpectedSpacetest struct {
        A int `json:"a,omitempty"`
-       B int `json:"b, omitempty"` // ERROR "suspicious space found in struct tag value"
+       B int `json:"b, omitempty"` // ERROR "suspicious space in struct tag value"
        C int `json:"c ,omitempty"`
-       D int `json:"d,omitempty, string"` // ERROR "suspicious space found in struct tag value"
+       D int `json:"d,omitempty, string"` // ERROR "suspicious space in struct tag value"
        E int `xml:"e local"`
-       F int `xml:"f "`                 // ERROR "suspicious space found in struct tag value"
-       G int `xml:" g"`                 // ERROR "suspicious space found in struct tag value"
-       H int `xml:"h ,omitempty"`       // ERROR "suspicious space found in struct tag value"
-       I int `xml:"i, omitempty"`       // ERROR "suspicious space found in struct tag value"
-       J int `xml:"j local ,omitempty"` // ERROR "suspicious space found in struct tag value"
-       K int `xml:"k local, omitempty"` // ERROR "suspicious space found in struct tag value"
-       L int `xml:" l local,omitempty"` // ERROR "suspicious space found in struct tag value"
-       M int `xml:"m  local,omitempty"` // ERROR "suspicious space found in struct tag value"
-       N int `xml:" "`                  // ERROR "suspicious space found in struct tag value"
+       F int `xml:"f "`                 // ERROR "suspicious space in struct tag value"
+       G int `xml:" g"`                 // ERROR "suspicious space in struct tag value"
+       H int `xml:"h ,omitempty"`       // ERROR "suspicious space in struct tag value"
+       I int `xml:"i, omitempty"`       // ERROR "suspicious space in struct tag value"
+       J int `xml:"j local ,omitempty"` // ERROR "suspicious space in struct tag value"
+       K int `xml:"k local, omitempty"` // ERROR "suspicious space in struct tag value"
+       L int `xml:" l local,omitempty"` // ERROR "suspicious space in struct tag value"
+       M int `xml:"m  local,omitempty"` // ERROR "suspicious space in struct tag value"
+       N int `xml:" "`                  // ERROR "suspicious space in struct tag value"
        O int `xml:""`
        P int `xml:","`
        Q int `foo:" doesn't care "`