1
0
mirror of https://github.com/golang/go synced 2024-11-06 10:36:13 -07:00
Commit Graph

1870 Commits

Author SHA1 Message Date
Robert Griesemer
5b72e8e9bb cmd/vet: switch to go/types from std repo
Depends on https://golang.org/cl/8767/.

With this change, cmd/vet does not depend on x/tools anymore
and could be moved into the std repo if so desired.

Change-Id: Ia205c6e1a6a63eebb27776064e5c24491043b683
Reviewed-on: https://go-review.googlesource.com/8791
Reviewed-by: Rob Pike <r@golang.org>
2015-04-14 00:30:21 +00:00
Robert Griesemer
069d2f3bcb go/types, go/gcimporter: backport changes from std repo
This is a 1:1 backport of the following changes:

https://go-review.googlesource.com/8611
https://go-review.googlesource.com/8621

Change-Id: I4a75d73cb99a7d104d32553f5530408c2b6d81b8
Reviewed-on: https://go-review.googlesource.com/8629
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-04-08 18:15:25 +00:00
Robert Griesemer
bf8b6a5c4c go/types: reenable disabled test (backport from std repo go/types)
Change-Id: I93a914dcfc5bd2cfa8078cec683a46225b665e44
Reviewed-on: https://go-review.googlesource.com/8626
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-04-08 16:31:48 +00:00
Robert Griesemer
48e2a5be44 cmd/vet: remove dependency on go/ast/astutil
This package was only imported for the trivial Unparen function.

Change-Id: I0ead916a7fdb469a26b4fe99c6964a8ed1438c49
Reviewed-on: https://go-review.googlesource.com/8566
Reviewed-by: Rob Pike <r@golang.org>
2015-04-08 15:52:25 +00:00
Tommy Schaefer
0770aced4f cmd/tipgodoc: Kill godoc process if http.ListenAndServe fails
Currently, if for some reason http.ListenAndServe fails, any running
running godoc processes don't get killed. I don't think this would ever
actually happen because, with godoc being set up in a separate go
routine, http.ListenAndServe would always(?) fail before the godoc
server started.

This change ensures that, if a Proxy has a cmd, it is closed when
http.ListenAndServe fails.

Change-Id: I0d3bfae0c16bc583248c2052a4d7a84c95127e76
Reviewed-on: https://go-review.googlesource.com/8570
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-08 14:14:19 +00:00
Alan Donovan
8a634c5831 go/ssa/interp: don't let target calls to runtime.GOMAXPROCS set host state
...otherwise the interpreted program can make the whole test suite
slow.  Just ignore the argument and return the current GOMAXPROCS
value.

Change-Id: Ife2ad6c53e6fdf9feea1d1b231d8d796b3db3a24
Also: add missing intrinsic for os.runtime_beforeExit.
Reviewed-on: https://go-review.googlesource.com/8591
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-04-07 22:31:19 +00:00
Alan Donovan
4a08fb6fc3 cmd/vet: -unusedresult: report calls of pure functions in expression statements
Change-Id: Ib8b6eaecd56ae15c44fb8ac11c781244964428f1
Reviewed-on: https://go-review.googlesource.com/6661
Reviewed-by: David Symonds <dsymonds@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-04-06 21:44:23 +00:00
Alan Donovan
ab1b92fc43 oracle: ignore errors during import graph construction
Such errors include files without package decl, or conflicting package
decls.  We ignore type errors, so we should ignore import errors too.

Fixes #10347

Change-Id: I9011a9099a2804281ea2d989d7263a9ce691be16
Reviewed-on: https://go-review.googlesource.com/8498
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-06 19:51:23 +00:00
Robert Griesemer
5cf8a6b1aa go/types: remove dependency on go/ast/astutil
This package was only imported for the trivial Unparen function.

Change-Id: I14f8d91bc0afaa6ab3aa797a53e42e56b59ffcbe
Reviewed-on: https://go-review.googlesource.com/8499
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-04-06 19:33:09 +00:00
Alan Donovan
f0d8175b3e oracle: skip cgo processing for queries that don't need SSA/PTA
This makes type-based queries faster and more robust because they
needn't invoke a C compiler, at the cost of worse results in/near .go
files that import "C".  It's particularly important for "referrers"
since a refererrs query on a name from the standard library can load
every package in the workspace.

Fixes issue 10347

Change-Id: I2f65474ce963de5c0897ba67eeb26290dd449cf1
Reviewed-on: https://go-review.googlesource.com/8493
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-06 16:52:07 +00:00
Alan Donovan
8a9ac1b806 go/loader: limit concurrency of I/O operations during parsing
This is a putative fix for the file descriptor exhaustion problem
described in https://github.com/golang/go/issues/10306.

Change-Id: If603fb9bbaec1b53f6b44d15b2c202e4670035ce
Reviewed-on: https://go-review.googlesource.com/8421
Reviewed-by: Matt Joiner <anacrolix@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-06 15:15:05 +00:00
Alan Donovan
a18bb1d557 oracle: add TODO
Change-Id: I315af962e43a3ae9c8e5cad13766d2200484fdf9
Reviewed-on: https://go-review.googlesource.com/8386
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-02 18:07:00 +00:00
Alan Donovan
d4e7010150 go/pointer: add TODO comment
Change-Id: Ic383036a6b3aa092aa571694bba86d821428f236
Reviewed-on: https://go-review.googlesource.com/8385
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-02 18:06:43 +00:00
Alan Donovan
c6a14e550a cmd/ssadump: fix usage message
Change-Id: I95fee5042e39156462a5c21ade29d7216474be02
Reviewed-on: https://go-review.googlesource.com/8384
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-04-02 16:54:45 +00:00
Rob Pike
65b5a8eca7 cmd/cover: cover funcs in if, for, switch clauses
This peculiar case arose in range statements but there are other contexts
and one turned up in the auto-generated translation of the compiler.
Take care of it always.

	for i := 0; i < 0; func() {i++; q=q.Link}() { ... }

That code has been given the obvious rewrite but we should still handle it.

Odd but easy to fix (tricky to test).

Fixes #10269.

Change-Id: I66e1404eb24da15a24be7f67403e19ed66fba0a7
Reviewed-on: https://go-review.googlesource.com/8284
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-31 19:20:52 +00:00
Alan Donovan
dce4131cda oracle: referrers: also scan *_test.go files for references.
Added test case.  This required making the result sort order
deterministic when the results are spread across several packages.

Also: implements: print type names relative to query package.
Updated tests.

Change-Id: I9f882cd358a612585a4aac9a117b89d9131a294e
Reviewed-on: https://go-review.googlesource.com/8283
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-31 16:25:39 +00:00
Alan Donovan
a27f5b3448 oracle: factor part of the initial setup for PTA queries
The check for len(argv)==0 now only applies to these modes.

Also, more consistent variable naming.

Change-Id: I9adb6bebc819eb43d54ddf63c42d952671ce9236
Reviewed-on: https://go-review.googlesource.com/8244
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-30 21:02:07 +00:00
Alan Donovan
b28839e4bd oracle: several major improvements
Features:

  More robust: silently ignore type errors in modes that don't need
  SSA form: describe, referrers, implements, freevars, description.
  This makes the tool much more robust for everyday queries.

  Less configuration: don't require a scope argument for all queries.
  Only queries that do pointer analysis need it.
  For the rest, the initial position is enough for
  importQueryPackage to deduce the scope.
  It now works for queries in GoFiles, TestGoFiles, or XTestGoFiles.
  (It no longer works for ad-hoc main packages like
  $GOROOT/src/net/http/triv.go)

  More complete: "referrers" computes the scope automatically by
  scanning the import graph of the entire workspace, using gorename's
  refactor/importgraph package.  This requires two passes at loading.

  Faster: simplified start-up logic avoids unnecessary package loading
  and SSA construction (a consequence of bad abstraction) in many
  cases.

  "callgraph": remove it.  Unlike all the other commands it isn't
  related to the current selection, and we have
  golang.org/x/tools/cmdcallgraph now.

Internals:

  Drop support for long-running clients (i.e., Pythia), since
  godoc -analysis supports all the same features except "pointsto",
  and precomputes all the results so latency is much lower.

  Get rid of various unhelpful abstractions introduced to support
  long-running clients.  Expand out the set-up logic for each
  subcommand.  This is simpler, easier to read, and gives us more
  control, at a small cost in duplication---the familiar story of
  abstractions.

  Discard PTA warnings.  We weren't showing them (nor should we).

  Split tests into separate directories (so that importgraph works).

Change-Id: I55d46b3ab33cdf7ac22436fcc2148fe04c901237
Reviewed-on: https://go-review.googlesource.com/8243
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-30 19:21:37 +00:00
Alan Donovan
68b5f7541d cmd/oracle: usability improvements to "describe", "referrers"
Emacs integration:
- eliminate oracle minor mode
- in go-mode, bind F5, F6 to "describe", "referrers".
  This reverts a previous policy decision but convenience matters too.
- don't insist on an analysis scope for modes that don't do PTA.
- don't hide the filename as "▶"; show the last 20 chars.
  (Especially useful for "referrers" mode.)
- output postprocessing: don't get stuck in a loop if the output
  is not as expected (e.g. when it includes a panic log).

referrers:
- show the matching lines (like grep does).
  We do the I/O in parallel.

Change-Id: I86b18c1d3a4d9fa4242984cba62b314796669d8e
Reviewed-on: https://go-review.googlesource.com/8120
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-30 19:04:01 +00:00
Josh Bleecher Snyder
57d2ff39c7 go/ast/astutil: match prefix segments when adding imports
AddImport and AddNamedImport attempt to place new
imports in roughly the correct place--and thus the
correct group--by matching prefixes. Matching prefixes
byte-by-byte led to "regexp" being grouped with "rsc.io/p".
Instead, match prefixes by segments.

Fixes golang/go#9961.

Change-Id: I52b7c58a9a2fbe85c2b5297e50c87d409364bda3
Reviewed-on: https://go-review.googlesource.com/8090
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-03-30 17:57:25 +00:00
Rob Pike
0c09ff325a cmd/cover: preserve //go: comments
Cover deleted all comments because they can break the simple way that
counters are injected into the rewritten source. But //go: comments have
semantic value, and for instance go test -cover runtime fails during
compilation because of their absence from the annotated source.

We can keep the //go: comments because they are at the beginning of
the line and are not affected by our counter injection.

Fixes #10270.

After this CL, go test -cover runtime works.
A testing strategy that does not involve a golden file would be welcome
but I can't think of one.

Change-Id: I73f7b7a36383a8efed8e33fa2414cd0eac7d015a
Reviewed-on: https://go-review.googlesource.com/8173
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-27 21:01:39 +00:00
Sameer Ajmani
1e216dc2e3 goimports: create a var to permit custom implementations of flag parsing and
startup work.

Change-Id: I9e60ec785313295bce614b5735238943af607223
Reviewed-on: https://go-review.googlesource.com/8204
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-27 18:14:11 +00:00
Rob Pike
e77366c32d cmd/cover: do not cover statements after panic
Given
	x()
	panic(1)
	y()

the y should not show as covered.

Fixes #10185

Change-Id: Iec61f1b096a888e6727be5f4526508654f5d3c91
Reviewed-on: https://go-review.googlesource.com/8140
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-27 17:59:54 +00:00
Robert Griesemer
af0a4481dd go/types: permit type elision from composite literal map keys
Per pending https://go-review.googlesource.com/2591 .
Depends on: https://go-review.googlesource.com/2621 .

Change-Id: I2aa82916454504b5852518b3ef7fc8637126d0c7
Reviewed-on: https://go-review.googlesource.com/2623
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-20 22:18:24 +00:00
Sebastien Binet
473fd854f8 godoc/static: insert newlines in -src mode
Running 'godoc -src' would end up with concatenated sources:

$ godoc -src github.com/bradfitz/http2 Frame
// a frameParser parses a frame given its FrameHeader and payload
// bytes. The length of payload will always equal fh.Length (which
// might be 0).
type frameParser func(fh FrameHeader, payload []byte) (Frame, error)//
A Frame is the base interface implemented by all frame types.
// Callers will generally type-assert the specific frame type:
// *HeadersFrame, *SettingsFrame, *WindowUpdateFrame, etc.
//
// Frames are only valid until the next call to Framer.ReadFrame.
type Frame interface {

Unconditionnally insert two newlines:

$ godoc -src github.com/bradfitz/http2 Frame
// a frameParser parses a frame given its FrameHeader and payload
// bytes. The length of payload will always equal fh.Length (which
// might be 0).
type frameParser func(fh FrameHeader, payload []byte) (Frame, error)

// A Frame is the base interface implemented by all frame types.
// Callers will generally type-assert the specific frame type:
// *HeadersFrame, *SettingsFrame, *WindowUpdateFrame, etc.
//
// Frames are only valid until the next call to Framer.ReadFrame.
type Frame interface {

Fixes #9726.

Change-Id: I51ee04e53d4962c890ea601125eda8fce84d6a46
Reviewed-on: https://go-review.googlesource.com/7681
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-18 17:28:59 +00:00
Josh Bleecher Snyder
8364437ab2 tools: add codereview.cfg
See golang.org/cl/4131 for context.

Change-Id: I474d4d455ad0207bf6cea6c36fc8bdcea3405b47
Reviewed-on: https://go-review.googlesource.com/7726
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-18 17:04:00 +00:00
Rob Pike
53f3b29c5d cmd/cover: fix race in test
Silly test added yesterday requires that some code in a goroutine executes.
Make sure it does.

Change-Id: I7e852454736e300151473986cc437a70b41dc9b7
Reviewed-on: https://go-review.googlesource.com/7691
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-17 21:45:36 +00:00
Alan Donovan
e591801c2d refactor/rename: fix misplaced 'continue'.
This was not a visible bug since the only caller discards the relevant
result, so I also deleted the result.

Fixes #9999

Change-Id: I276d6523b2891d3cb9c8137448e1aed32a5fd197
Reviewed-on: https://go-review.googlesource.com/5921
Reviewed-by: Michael Matloob <michaelmatloob@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-17 20:38:58 +00:00
Alan Donovan
bd8de46c84 go/ssa/interp/testdata: remove comment about now-fixed go/types bug
Change-Id: I55372a40c0049368a74247fe1819be384313f838
Reviewed-on: https://go-review.googlesource.com/7666
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-17 17:28:01 +00:00
Alan Donovan
2206711864 refactor/rename: don't make backups; overwrite in place, preserving inode.
This avoids littering the tree, and confusing some editors (e.g. Atom)
that expect the inode number to remain constant.

Change-Id: I2faeda1ed1b01e5e4cc720744ea3c99ab29e7333
Reviewed-on: https://go-review.googlesource.com/7664
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-17 16:03:22 +00:00
Alan Donovan
782516301f cmd/eg: improve usage and help messages
eg with no arguments prints its usage, including a hand-written flag summary.
eg -help shows the detailed help message.

Change-Id: I615d8de3985ced1e86e9d7cafa9ef679079b249c
Reviewed-on: https://go-review.googlesource.com/6951
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-17 16:03:11 +00:00
Alan Donovan
33fcc815f2 go/ssa: fix incorrect SSA code for composite literals
Composite literals are initialized in place where possible, but in
cases the initializer expression refers to the variable that
is being updated

	x = T{a: x.a}

we must ensure that the RHS is fully evaluated before we execute any
stores to x.  This means we need to record the sequence of stores in a
"store buffer" and execute it only once the entire composite literal
has been evaluated.

Fixes issue #10127

Change-Id: If94e3b179beb25feea5b298ed43de6a199aaf347
Reviewed-on: https://go-review.googlesource.com/7533
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-17 14:26:39 +00:00
Rob Pike
ed1e7c5cf2 vet: fix documentation about recursive scanning
It used to do packages only when run by the go tool, but it was
fixed a while back to handle packages properly when doing a
directory walk. Remove the incorrect information from the
documentation.

Change-Id: I961340bb84e48474c94ee03bf88f9136492c0226
Reviewed-on: https://go-review.googlesource.com/7642
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-17 00:40:15 +00:00
Rob Pike
26365e4e90 cmd/cover: fix handling of empty type switch
Just missed a case (ha!) in the tree walk. Dup the code for an empty switch, add test.

Fixes #10163.

Change-Id: I3d50ab6cb450ca21e87213291eaab8cbe924fac5
Reviewed-on: https://go-review.googlesource.com/7641
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-16 22:10:38 +00:00
Dave Cheney
0ee0dd6ea8 cmd/godoc: skip tests on arm platforms
Skip tests on arm platforms.

The godoc tests require large amounts of memory, in excess of 700mb in -index mode which none of the arm builders have spare.

Because of their requirements the tests can be killed by the test runner leaving stray godoc processes spinning in swap trying to -index.

Change-Id: I1544d56e9d9aabbbaac21adeebfb9e2690bd2da5
Reviewed-on: https://go-review.googlesource.com/7540
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-16 02:06:44 +00:00
Robert Griesemer
e4a1c78f0f go/types: typecheck loop body even if range clause is broken
Be more tolerant in the presence of incorrect range clauses
if for loops and type-check loop body with minimal assumptions
about iteration variables. (Before, in some cases we would simply
ignore the loop body in such cases).

Fixes #10148.

Change-Id: I0b66f81875348088c1a7fa04ccdcbfe768f2eb6c
Reviewed-on: https://go-review.googlesource.com/7525
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-13 23:02:41 +00:00
Alan Donovan
868c429971 go/ssa/interp: fix bug causing subelements of aggregates to change address.
Since all SSA values are immutable, no value copying is required for
any operations except those that load from or store to a variable;
those operations must do an aggregate copy, i.e., descend into struct
and array elements.  All other calls to copyVal have been removed;
they were pieces of duct tape, as I had long suspected.

The descent must be based on the static type information, not the
"shape" of the dynamic value, since two reflect.Value structs may have
different internal shapes.  We clobber the true definition of
reflect.Value's underlying type, replacing it with struct{interface{},
interface{}}, which is close enough to make the load/store functions
work.

+ Test

Change-Id: I5e239d91ed0cb2a669a9f75766024fe1f9a5c347
Reviewed-on: https://go-review.googlesource.com/7532
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-13 18:22:38 +00:00
Alan Donovan
8cc1c75580 go/loader: support relative imports like the go tool does
Config.Cwd sets the base directory; os.Getwd is its default.

+Test.

Change-Id: I213abfb30085cd1306719ed6f94aeae6a3170bc0
Reviewed-on: https://go-review.googlesource.com/7502
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-12 18:51:46 +00:00
Alan Donovan
bf80246757 oracle/testdata: avoid sort.Sort so that my $GOROOT doesn't appear in output
Sorry for the oversight.

Change-Id: Ibb686dbee996b5223bd223fdd3afaab243a7a3ee
Reviewed-on: https://go-review.googlesource.com/7501
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-12 18:36:52 +00:00
Péter Surányi
8239116d59 cmd/godoc: exclude /pkg from search indexing
On tip, search included redundant source results from /pkg/bootstrap
(with broken links as godoc doesn't support source files under /pkg).
This change excludes all directories under /pkg from indexing.

Fixes golang/go#10024.

Change-Id: I0c69d22ff08d131f9c37c91a7711db6a4ec53fd4
Reviewed-on: https://go-review.googlesource.com/7267
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-12 00:26:38 +00:00
Andrew Gerrand
3b0cd1bf65 cmd/tipgodoc: increase startup 'health check' deadline
Also use a more reliable implementation.

Change-Id: I9e6858c7e9bdb60f1fb4e060e6d4d1b3762b83bc
Reviewed-on: https://go-review.googlesource.com/7260
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-10 03:04:16 +00:00
Péter Surányi
a160d803d7 cmd/tipgodoc: enable indexing
Run godoc indexing just once on startup. Wait for indexing to complete
before switching to new side. Increase startup timeout to accommodate for
indexing.

Updates golang/go#9996.

Change-Id: I1e746a68b7d787e6d7f180c2617ea75f0d3291f8
Reviewed-on: https://go-review.googlesource.com/7120
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-09 23:33:43 +00:00
Paul Smith
92211c448d cmd/stringer: remove os.Exit call from Usage func
The caller of Usage should call os.Exit -- Usage shouldn't call it.

Change-Id: I3decf662883fb2a6b19b7035138ee8a06a02de08
Reviewed-on: https://go-review.googlesource.com/7110
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-09 01:18:24 +00:00
Péter Surányi
c327a7c00b cmd/godoc: add -index_interval
Updates golang/go#9996.

Change-Id: I6112b1c32832aaa6604b096cfe7a8833f092b17a
Reviewed-on: https://go-review.googlesource.com/7031
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-06 23:07:47 +00:00
Alan Donovan
bdcea2c1b3 go/buildutil: use chan (not func) in the ForEachPackage API
The callbacks are intentionally concurrent, making this function very
easy to misuse (most clients so far have got it wrong, even my own).
Using a channel in the API makes the concurrency obvious, the
correct usage easy, and the client control flow simpler.

Change-Id: Ied38c3ed5c98b40eb1b322a984ed9dc092ac0918
Reviewed-on: https://go-review.googlesource.com/3250
Reviewed-by: Sameer Ajmani <sameer@golang.org>
2015-03-05 20:14:20 +00:00
Alan Donovan
9957739054 go/ssa: treat declared init functions less specially
Before this change, declared init functions were not package members;
this choice dates from when go/types did not create Func objects for them.

Now, they have an Object.  They appear in Members, keyed by "init#%d"
(sequence number) for uniqueness.  They can be enumerated.  They can
be looked up from a *types.Func via (*Program).FuncValue.

Caveat: fn.Object.Name() no longer equals fn.Name() in all cases.

NB: incompatible API change!  (Your build will not break though.)

Change-Id: I2de873079fd57329e6c2f55a282940f6699a77a1
Reviewed-on: https://go-review.googlesource.com/6950
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Peter Collingbourne <pcc@google.com>
2015-03-05 20:09:21 +00:00
Alan Donovan
4744be3abc refactor/eg: use format.Node not printer.Fprint for canonical output
Fixes golang/go#10038

Change-Id: If3243f0c68fc0442dcc1e2dd71cbdc629beff70c
Reviewed-on: https://go-review.googlesource.com/6481
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-03-02 19:38:58 +00:00
Robert Griesemer
133ecf9210 go/types: better error message for use of _ in type switch
Change-Id: If690d2d9607b3632451df2681c293835321ed9bd
Reviewed-on: https://go-review.googlesource.com/6413
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-02 18:58:57 +00:00
Péter Surányi
705f1dfb24 godoc/static: fix variable reference in search.txt
Change to match searchdoc.html which works.
(Was referring to "$val.Idents" in line 26, but "$val" here is
already an element of Idents.)
Also clarify naming and comments for makestatic.

Fixes golang/go#10022.

Change-Id: Ia3f2fdadd5d10f31a1825e8db966b6e92da2b93e
Reviewed-on: https://go-review.googlesource.com/6236
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-02 02:09:35 +00:00
Alan Donovan
8913eaef75 go/loader: name unnamed packages so errors make sense
Add tests for:
- this naming
- missing file in created package

Change-Id: I07c66b66e845c52d4685509c362b34f1f0c92648
Reviewed-on: https://go-review.googlesource.com/6310
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-02-27 22:39:28 +00:00