Commit 734487c9 authored by Russ Cox's avatar Russ Cox

cmd/vet: shorten diagnostic about suspicious struct tag spaces

Change-Id: I112d0164df6abd9ca1df287376cf3605268385df
Reviewed-on: https://go-review.googlesource.com/78116
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: 's avatarRob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c8691f3a
......@@ -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")
)
......
......@@ -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 "`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment