1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:14:45 -07:00
go/go
André Martins 73b12cab25 go/analysis/passes/structtag: ignore warning if tag should be ignored
Having a private field with a json tag does not necessary means the
field needs to be exposed publicly. This change ignores the warning of
such fields that contain a json tag with the field tag "-".

The lines added in the unit tests will fail without these changes with
the error:
```
a/a.go:36:2: unexpected diagnostic: struct field b has json tag but is not exported
```

Change-Id: Ife987b99c264ae3b60a702e43a1f9c778f8c2d62
Reviewed-on: https://go-review.googlesource.com/c/tools/+/245857
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-08-10 15:05:53 +00:00
..
analysis go/analysis/passes/structtag: ignore warning if tag should be ignored 2020-08-10 15:05:53 +00:00
ast go/ast/inspector: impose maximum capacity 2020-04-10 18:16:43 +00:00
buildutil all: fix more typos 2019-09-11 15:13:14 +00:00
callgraph all: add a space before +build in build tag comments 2019-09-08 12:23:18 +00:00
cfg all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
expect all: update dependencies in go.mod file 2020-07-06 23:19:48 +00:00
gccgoexportdata go/gccgoexportdata: correctly handle archive files containing string tables 2016-11-09 21:28:38 +00:00
gcexportdata Revert "go/internal/gcimporter: remove support for binary export data" 2020-05-26 20:26:39 +00:00
internal all: replace build tags in tests with testenv helper 2020-05-27 18:32:53 +00:00
loader go/loader: remove check on ioutil.TestTempFile in TestStdlib 2020-04-13 16:19:37 +00:00
packages go/packages: expand cases when filenames are parsed from errors 2020-08-05 15:52:14 +00:00
pointer all: fix some staticcheck errors 2020-01-29 04:53:41 +00:00
ssa go/ssa/interp: avoid vet warning about string(int) conversion 2020-05-13 01:50:45 +00:00
types go/types/objectpath: cache result of call to scope.Names 2020-05-05 02:31:15 +00:00
vcs go/vcs: ignore "mod" VCS type 2019-05-06 14:53:03 +00:00