1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:04:57 -07:00
Commit Graph

1254 Commits

Author SHA1 Message Date
Alan Donovan
c6ec5ea66d cmd/gorename: support renaming of methods with consequences for other types, iff initiated at an abstract method.
Previously, gorename rejected all method renamings if it would
change the assignability relation.

Now, so long as the renaming was initiated at an abstract
method, the renaming proceeds, changing concrete methods (and
possibly other abstract methods) as needed.  The user
intention is clear.

The intention of a renaming initiated at a concrete method is
less clear, so we still reject it if it would change the
assignability relation.  The diagnostic advises the user to
rename the abstract method if that was the intention.

Additional safety checks are required: for each
satisfy.Constraint that couples a concrete type C and an
interface type I, we must treat it just like a set of implicit
selections C.f, one per abstract method f of I, and ensure the
selections' meanings are unchanged.

The satisfy package no longer canonicalizes types, since this
substitutes one interface for another (equivalent) one, which
is sound, but makes the type names random and the error
messages confusing.

Also, fixed a bug in 'satisfy' relating to map keys.

+ Lots more tests.

LGTM=sameer
R=sameer
CC=golang-codereviews
https://golang.org/cl/173430043
2014-12-04 09:37:50 -05:00
Andrew Gerrand
7e91bb35f8 x/tools/dashboard/watcher: convert to git
LGTM=dsymonds
R=bradfitz, dsymonds
CC=golang-codereviews
https://golang.org/cl/177660043
2014-12-04 10:47:26 +11:00
Andrew Gerrand
2d83fa5bf1 x/tools/dashboard/app: update to support git
This adds a "Git" dashboard at "/git/", which has its own namespace for
datastore and memcache. Once we have pushed out the new git repositories
we will spin up a commit watcher and builders that point to the Git
dashboard.

Once we are ready to switch the dashboard over to the new Git builders,
the (*Dashboard).Context method will be changed to return "Git"
as the default namespace. The old builders will be retired, and the
new builders will be configured to report to "/" instead of "/git/".
At that point all our old data will still be available in the default
namespace, but hidden from view.

LGTM=dsymonds, cmang
R=bradfitz, cmang, dsymonds, adg
CC=golang-codereviews
https://golang.org/cl/183050043
2014-12-04 10:45:11 +11:00
Andrew Gerrand
4ed659d592 x/tools/dashboard/builder: support git; remove commit watcher
This binary isn't intended to support hg anymore.
It almost might not support gccgo; I'm not sure.
But there'll be more work to do there anyway.

LGTM=dave, bradfitz, cmang
R=cmang, bradfitz, dave, adg
CC=golang-codereviews
https://golang.org/cl/181520043
2014-12-04 10:43:53 +11:00
Andrew Gerrand
a652b8bab4 x/tools/go/vcs: support go.googlecode.com paths
Also fix a bug in CreateAtRev, which was doing something hg-specific.

LGTM=cmang
R=cmang
CC=golang-codereviews
https://golang.org/cl/180540043
2014-12-04 10:43:23 +11:00
Alan Donovan
41f0d01034 refactor/importgraph: fix a race condition.
The main goroutine wasn't waiting for the two closed channels to drain.

Moral: with concurrency, never invent.  D'oh.

LGTM=sameer
R=sameer
CC=golang-codereviews
https://golang.org/cl/178090043
2014-12-03 09:56:23 -05:00
Rob Pike
0e9050009a tools/cmd/vet: check that cgo is enabled before testing it
Should fix the tools builders.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/176530043
2014-12-02 08:15:26 +09:00
Chris Manghane
9393b17080 dashboard/env: add go-commit-watcher image
LGTM=bradfitz
R=bradfitz, adg
CC=adg, golang-codereviews
https://golang.org/cl/179370043
2014-12-01 09:59:02 -08:00
Nathan John Youngman
806f1dbf43 tools/cmd/stringer: fake import C.
Avoid error "could not import C (can't find import: C)"
Fixes golang/go#9169.

LGTM=adonovan, r
R=golang-codereviews, adonovan, r
CC=golang-codereviews
https://golang.org/cl/184730043
2014-11-27 15:36:14 +11:00
Andrew Gerrand
354b6ccbcc x/tools/cmd/godoc: add golang.org/x/oauth2 import path
LGTM=r
R=jbd, r
CC=golang-codereviews
https://golang.org/cl/175700043
2014-11-26 15:31:30 +11:00
Andrew Gerrand
8dfc1ba4d0 x/tools/dashboard/app: have cron.yaml point to build.golang.org
LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/174600043
2014-11-24 18:08:25 +11:00
Andrew Gerrand
566014162e x/tools/godoc/redirect: handle Rietveld and Gerrit CLs at /cl/
LGTM=rsc, dsymonds
R=rsc, dsymonds
CC=golang-codereviews
https://golang.org/cl/177260043
2014-11-24 13:25:05 +11:00
Robert Griesemer
cc6170934b go/exact: handle unknowns consistently
Fixes golang/go#9147.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/180110043
2014-11-21 13:08:59 -08:00
Alan Donovan
a9651d6ad7 cmd/callgraph: add -algo=static and -algo=cha options.
"static" ignores dynamic calls altogether.

"cha" uses Class Hierarchy Analysis, which assumes that a
dynamic call may dispatch to any func or method that satisfies
the type.

Both these algorithms can work on partial programs,
e.g. libraries without a main function or tests.

(This feature was requested after my talk last night.)

+ Tests.

LGTM=sameer
R=sameer, minux
CC=golang-codereviews, gri
https://golang.org/cl/176780043
2014-11-21 11:07:56 -05:00
Alan Donovan
ce7df396da go/pointer: fix two crashes caused by 'print()'.
+ Test.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/173540043
2014-11-20 13:33:20 -05:00
Andrew Gerrand
4f9827a99d x/tools/cmd/godoc: fix bad repository path
Not caught by inattentive reviewer. Pick up your game, people.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/180880043
2014-11-19 15:51:44 +11:00
Andrew Gerrand
1536a92c03 x/tools/cmd/godoc: add golang.org/x/review custom import path
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/174410043
2014-11-19 14:03:19 +11:00
Andrew Gerrand
a3be5384d5 x/tools/godoc/redirect: add redirect for Gerrit reviews at /review/
LGTM=rsc, bradfitz
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/178960043
2014-11-19 08:51:39 +11:00
Alan Donovan
0088b7ecd7 go/types: don't panic if DefaultImport==nil, until we actually use it.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/178860044
2014-11-17 15:24:12 -05:00
Alan Donovan
89c9513804 go/types/typeutil: add an example of Map usage.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/177740043
2014-11-17 13:54:36 -05:00
Alan Donovan
d75c6bdb8f cmd/oracle: minor fixes.
- print "oracle:" not "Error:" in error messages; remove period.
- allocate token.FileSet correctly.
- remove stale TODO (multiple test packages)
- fix typo and omission ('what') in usage message.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/178860043
2014-11-17 13:50:23 -05:00
Alan Donovan
4162082cba x/tools/*: print program name, not "Error", when reporting command error messages.
Such messages are more informative when the error occurs deep within a script.

Also: add tool name to digraph's usage messages.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/173380043
2014-11-17 12:58:28 -05:00
Alan Donovan
0ae83e44ba refactor/rename: add missing operand to fmt.Errorf
TBR=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/177920043
2014-11-17 12:17:16 -05:00
Andrew Gerrand
33b1bf3b85 x/tools/dashboard/env: bump known good builder revision
LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://golang.org/cl/176900043
2014-11-17 13:08:44 +11:00
Andrew Gerrand
9920aceb57 x/tools/dashboard/builder: only write VERSION file if it doesn't exist
LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://golang.org/cl/172610043
2014-11-17 12:06:56 +11:00
Andrew Gerrand
c2c2cf49ad x/tools/dashboard/app: ignore freebsd-arm failures
The previous instance of this change was applied to the release branch.
I don't know why the codereview plugin allowed me to do this.
Thankfully we won't be using it for much longer.

TBR=dfc
R=dave
CC=golang-codereviews
https://golang.org/cl/175870044
2014-11-17 11:32:13 +11:00
Alan Donovan
c13d674f5e go/callgraph/rta: rename from go/rta
LGTM=sameer
R=sameer
CC=golang-codereviews, gri
https://golang.org/cl/175770043
2014-11-14 11:02:44 -05:00
Alan Donovan
50755a56a8 go/ssa: report memory consumption separated by phase in stdlib_test
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/170600043
2014-11-13 13:03:59 -05:00
Alan Donovan
b8d26f5b94 tools: minor comment fixes.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/173170043
2014-11-13 12:34:25 -05:00
Andrew Gerrand
c05aea77a9 x/tools/dashboard/app: use ?branch=foo to show foo branch commits
LGTM=rsc
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/167660043
2014-11-13 21:53:13 +11:00
Robert Griesemer
c2b324b9b4 cmd/callgraph: fix build
TBR=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/171640043
2014-11-12 16:49:47 -08:00
Robert Griesemer
932b62a02f go/types: add missing nil check in Info.TypeOf
Also use type assertions in a more defensive
way (check for != nil rather than ok).

LGTM=dsymonds, adonovan
R=adonovan, dsymonds
CC=golang-codereviews
https://golang.org/cl/169480043
2014-11-12 15:39:43 -08:00
Alan Donovan
b8a5fcfcec cmd/callgraph: a utility for dumping the callgraph of a Go program.
(This functionality is provided by the oracle, but its output
format is inflexible, and the functionality is better suited
to a shell utility.  I may remove the oracle 'callgraph' feature.)

See Usage for details.

+ Test.

LGTM=sameer
R=sameer
CC=golang-codereviews, gri
https://golang.org/cl/164460044
2014-11-12 17:36:22 -05:00
Alan Donovan
194c5aa350 go.tools/go/rta: implement Rapid Type Analysis for Go.
This is an algorithm for callgraph construction that is faster
but much less precise than pointer analysis.
(I evaluated this for the Go Oracle last year but shelved it,
but it's a natural fit for the work Brian is doing on
automatic program minimization.)

LGTM=sameer
R=gri, crawshaw, sameer
CC=bwkster, golang-codereviews
https://golang.org/cl/124690043
2014-11-12 17:34:15 -05:00
Dmitri Shuralyov
a26eca502f go.tools/imports: use same logic as 'go' tool for pruning package search.
The previous logic would descend into "_"-prefixed names, "testdata" folders,
and skipped folders beginning with a digit.

Fixes golang/go#8958.

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz
CC=golang-codereviews
https://golang.org/cl/167000043
2014-11-12 12:45:17 -08:00
Alan Donovan
c097262a24 cmd/digraph: support Go-style double-quotes in input data.
+ test.

LGTM=sameer
R=sameer
CC=golang-codereviews, gri
https://golang.org/cl/170090043
2014-11-12 13:37:06 -05:00
Alan Donovan
fb44a24d4c refactor/rename: fix crash when renaming anonymous struct field that's a qualified reference
(or a pointer, or both).

+ test

Fixes bug 8924

LGTM=sameer
R=dominik.honnef, sameer
CC=<dominik.honnef, golang-codereviews
https://golang.org/cl/158920043
2014-11-10 16:03:40 -05:00
Andrew Gerrand
ab43333964 x/tools/dashboard/app: respect gohash in Commit.AddResult
This should fix the issue where results sub-repo results are clobbered
by subsequent commits. (Much like the previous fix, which only
fixed the issue for main repo commits.)

TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/167440044
2014-11-10 13:58:29 +11:00
Andrew Gerrand
8bd0dd9d19 x/tools/dashboard/coordinator: provide build key in / and /root
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/170260044
2014-11-10 13:22:35 +11:00
Andrew Gerrand
df7f175a64 x/tools/dashboard/app: revert sub-repo path rename
We're going to keep the old paths in the dashboard until
after Go 1.4 is out the door.

TBR=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/169240044
2014-11-10 13:21:57 +11:00
Andrew Gerrand
42bbc3ebf0 x/tools/dashboard/app: prevent builders from nuking other results
This fixes the issue where a builder would occasionally wipe out
the results from another builder.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/172150043
2014-11-10 13:18:31 +11:00
Andrew Gerrand
3ee677ac1c go.tools/dashboard/env: use newer builder
This version of the builder can handle the new golang.org/x/ paths.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/174750043
2014-11-10 11:49:19 +11:00
Andrew Gerrand
bdb10cf821 go.tools/dashboard/builder: rewrite sub-repo paths before 'go get' and 'go test'
The dashboard still uses the old "code.google.com/p/go.*" import paths.
Rewrite them to the new "golang.org/x/*" before running 'go get' and 'go test'.

Update golang/go#9079.

LGTM=rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/174740043
2014-11-10 10:42:45 +11:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00
Alan Donovan
3191bbae17 go/buildutil: call ReadDir via the build.Context's file system interface
LGTM=gri
R=gri, crawshaw
CC=golang-codereviews
https://golang.org/cl/171920043
2014-11-05 12:34:34 -05:00
Andrew Gerrand
ef648ad89b go.tools/godoc/static: replace bake.sh with "go generate" rule
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/164490043
2014-11-05 16:52:40 +11:00
Austin Clements
348181cdd4 cmd/vet: tests for RET checking, SP checking, and leaf functions
Add tests for recently introduced asm error checks in vet.
This adds tests for the new warnings about functions that
don't store to their return slot before returning or that
store to SP-relative addresses in or beyond the argument
frame.  It also adds a test for leaf function handling on arm,
where the link register is not implicitly saved.

LGTM=rsc
R=rsc
CC=adg, golang-codereviews, r
https://golang.org/cl/166040044
2014-11-03 17:27:41 -05:00
Austin Clements
52f3c4bf8a cmd/vet: update test patterns to include asm function name
vet now includes function names in its error messages about
assembly code.  Update the error test patterns to account for
this and expand some patterns to check that go vet discovers
the function name correctly.

Fixes golang/go#9041

LGTM=r
R=adg, r, rsc
CC=golang-codereviews
https://golang.org/cl/170940044
2014-11-02 12:21:04 -05:00
Alan Donovan
d73c11bfcb refactor/rename: make -from syntax support string literals for complex import paths.
(They may contain any character, after all.)

Also, allow but don't require parens and stars.
e.g. (*"encoding/json".Decoder).Decode or "encoding/json".Decoder.Decode
     but not encoding/json.Decoder.Decode.

Since -from queries are now Go expressions, we use the Go parser.
(Thanks to Rog Peppe for the suggestion.)

LGTM=sameer
R=sameer
CC=golang-codereviews, gri, rogpeppe
https://golang.org/cl/154610043
2014-10-31 15:39:22 -04:00
Andrew Gerrand
cf285cde60 go.tools/dashboard/app: fix tests
TBR=dvyukov
R=dvyukov, bradfitz
CC=golang-codereviews
https://golang.org/cl/165740043
2014-10-31 09:04:03 +11:00