Skip to content

Commit d6cc3cd

Browse files
dsnetgopherbot
authored andcommitted
go/analysis/passes/structtag: ignore findings for "encoding/json/v2"
The v2 "json" effort will eventually live in "encoding/json/v2". Ignore structtag findings there as we assume that the package is testing its own behavior with invalid struct tags. Change-Id: I0ac0e7bf1f11d02dfcd1fabc17bde3c7ff59312f Reviewed-on: https://go-review.googlesource.com/c/tools/+/639295 LUCI-TryBot-Result: Go LUCI <[email protected]> Run-TryBot: Joseph Tsai <[email protected]> Auto-Submit: Joseph Tsai <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 666fab2 commit d6cc3cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/analysis/passes/structtag/structtag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var checkTagSpaces = map[string]bool{"json": true, "xml": true, "asn1": true}
8989
// checkCanonicalFieldTag checks a single struct field tag.
9090
func checkCanonicalFieldTag(pass *analysis.Pass, field *types.Var, tag string, seen *namesSeen) {
9191
switch pass.Pkg.Path() {
92-
case "encoding/json", "encoding/xml":
92+
case "encoding/json", "encoding/json/v2", "encoding/xml":
9393
// These packages know how to use their own APIs.
9494
// Sometimes they are testing what happens to incorrect programs.
9595
return

0 commit comments

Comments
 (0)