1
0
mirror of https://github.com/golang/go synced 2024-11-19 07:54:43 -07:00
go/cmd/vet
Alan Donovan ced954c167 go.tools/go/types: split Info.Objects map into Defs and Uses.
An identifier X in anonymous struct field struct{X} is both a
definition of a field (*Var) and reference to a type
(*TypeName).  Now that we have split the map, we can capture
both of these aspects.

Interestingly, every client but one was going to extra effort
to iterate over just the uses or just the defs; this
simplifies them.

Also, fix two bug related to tagless switches:
- An entry was being recorded in the Object map for a piece of
  synthetic syntax.
- The "true" identifier was being looked up in the current scope,
  which allowed perverse users to locally redefine it.  Now
  we use the bool (not untyped boolean) constant true, per the
  consequent clarification of the spec (issue 7404).

+ tests.

Fixes golang/go#7276

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/68270044
2014-02-27 13:21:59 -05:00
..
testdata cmd/vet: check for nil result set in isStringer 2014-02-24 11:39:42 -08:00
whitelist cmd/vet: move whitelist to its own package 2013-08-20 15:39:49 -07:00
asmdecl.go go.tools/cmd/vet: handle symbolic TEXT annotations 2013-11-01 11:49:11 -07:00
assign.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
atomic.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
buildtag.go go.tools/cmd/vet: improve error message for build tag problems 2013-12-18 16:06:56 -08:00
composite.go cmd/vet: move whitelist to its own package 2013-08-20 15:39:49 -07:00
copylock.go go.tools/go/types: remove Type.MethodSet() method. 2014-02-11 16:49:27 -05:00
deadcode.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
doc.go cmd/vet: check for nil result set in isStringer 2014-02-24 11:39:42 -08:00
main.go go.tools/go/types: split Info.Objects map into Defs and Uses. 2014-02-27 13:21:59 -05:00
method.go go.tools/cmd/vet: Update canonical method check for new xml.Marshaler/Unmarshaler interfaces 2013-10-07 11:10:36 -07:00
nilfunc.go go.tools/go/types: split Info.Objects map into Defs and Uses. 2014-02-27 13:21:59 -05:00
print.go go.tools/go/types: combine Info.{Types,Values} maps. 2014-01-28 16:46:24 -05:00
rangeloop.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
shadow.go go.tools/go/types: split Info.Objects map into Defs and Uses. 2014-02-27 13:21:59 -05:00
structtag.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
types.go go.tools/go/types: split Info.Objects map into Defs and Uses. 2014-02-27 13:21:59 -05:00
vet_test.go go.tools/cmd/vet: disable TestVet on Plan 9 2014-02-20 21:43:24 +01:00