]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: check for duplicate json, xml struct field tags
authorAlex Browne <stephenalexbrowne@gmail.com>
Sun, 8 Nov 2015 04:54:41 +0000 (23:54 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 13 Oct 2016 02:08:58 +0000 (02:08 +0000)
commit4940a8379096a48af682c266a0e104f249a80816
tree6aa9d5e464f0ace49fcf589a0c1509ce9956b5dd
parentab019da7272285fb4f634e7fca00c3fa973c76c4
cmd/vet: check for duplicate json, xml struct field tags

It is easy to make the mistake of duplicating json struct field
tags especially when copy/pasting. This commit causes go vet to
report the mistake. Only field tags in the same struct type are
considered, because that is the only case which is undoubtedly an
error.

Fixes #12791.

Change-Id: I4130e4c04b177694cc0daf8f1acaf0751d4f062b
Reviewed-on: https://go-review.googlesource.com/16704
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/vet/main.go
src/cmd/vet/structtag.go
src/cmd/vet/testdata/structtag.go