1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:54:44 -07:00
go/cmd
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
..
benchcmp go.tools/cmd/benchcmp: sort by original benchmark order by default 2014-02-19 07:44:49 -08:00
cover go.tools/cover: split parsing code out from cmd/cover 2013-12-03 20:55:21 -08:00
godoc godoc: Remove bogus messages referring to "/target". 2014-02-26 13:21:44 -05:00
goimports cmd/goimports: update doc, remove old gofmt flags 2014-02-12 08:35:02 -08:00
gotype cmd/gotype: add -gccgo flag 2014-01-08 15:25:17 -08:00
html2article go.tools/cmd/html2article: move command from go.blog repository 2013-09-27 10:40:53 +10:00
oracle go.tools: rename packages. 2014-01-16 09:33:58 -05:00
ssadump go.tools/go/loader: simplify command-line syntax. 2014-02-11 16:52:16 -05:00
vet go.tools/go/types: split Info.Objects map into Defs and Uses. 2014-02-27 13:21:59 -05:00