1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:18:32 -06:00
Commit Graph

1094 Commits

Author SHA1 Message Date
Andrew Gerrand
cb487641b8 go.tools/dashboard: fix integration test
LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/126700043
2014-08-26 17:34:24 +10:00
Brad Fitzpatrick
eb8b4b0d41 dashboard: start of Dockeritization of Linux builders
Good checkpoint. Can now do builds by hand.

Next step is coordinator server in front of this, and things
to fire up beefy GCE instances running CoreOS and each build
in its own Docker container. See README for how to do a single
build.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/134870043
2014-08-26 00:33:19 -07:00
Andrew Gerrand
51353854a4 go.tools/dashboard: display "-temp" builders last
LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/133000043
2014-08-26 14:49:16 +10:00
Paul Nasrat
89156360f9 go.tools/refactor/eg: Support promoted fields and methods.
As per http://golang.org/ref/spec#Struct_types enable eg tool
to wildcard match against promoted fields and methods.

LGTM=adonovan
R=adonovan, gordon.klaus
CC=golang-codereviews
https://golang.org/cl/129260043
2014-08-25 16:26:54 -04:00
Rob Pike
cd9959d796 go.tools/cmd/vet: validate calls to t.Log and t.Logf
Be careful not to complain about math.Log and cmplx.Log.
Seems worthwhile since t.Log and t.Logf are often written but
rarely executed.

Nothing new turned up in the standard library.

Fixes golang/go#8504.

LGTM=josharian, dsymonds
R=golang-codereviews, josharian, dsymonds
CC=golang-codereviews
https://golang.org/cl/130490043
2014-08-25 12:31:49 -07:00
Rob Pike
671b9204b8 go.tools/cmd/vet: change message for range check
s/enclosed by function/captured by func literal/
Users complained. They often do.

LGTM=josharian, adg
R=golang-codereviews, josharian, nightlyone, minux, adg
CC=golang-codereviews
https://golang.org/cl/132080043
2014-08-24 17:26:18 -07:00
Fatih Arslan
ba91af23b8 cmd/cover: add start lines numbers to each function in -func mode
This CL aims to fix the problem described here:

https://groups.google.com/forum/#!topic/golang-nuts/R6ms1n9KjiY

This makes it easier to parse via external tools such as editors. Editors can
show each function in a list and jump directly to each function with this
additional information. This pattern can be seen in other Go tools such as "go
test" in the form of:

--- FAIL: TestCover (0.52 seconds)
        cover_test.go:43: example error

LGTM=adg
R=r, adg, josharian, dave
CC=golang-codereviews
https://golang.org/cl/131820043
2014-08-21 16:28:12 -07:00
Andrew Gerrand
277e5a16d7 go.tools/godoc: mention sub-repos and package indexes on packages page
Also several cosmetic tweaks to the package page.

LGTM=r, bradfitz
R=bradfitz, r
CC=golang-codereviews
https://golang.org/cl/128490043
2014-08-21 09:53:57 +10:00
Rob Pike
f11381f265 go.tools/cmd/cover: don't assume code is gofmt'd
We want to make an if look like two blocks and have the coverage
report for the else block decorate the "else" keyword with the right
color. To do this, we adjust the apparent starting point of the else
block to include the "else".

The previous code assumed the way to do this was to move the
width of "else " backwards from the else block's opening brace, but
that assumes there is a space there. Instead, we now just start the
else block exactly at the end of the if block. Simpler, cleaner, and
fixes a bug.

Fixes golang/go#8557.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/127620043
2014-08-20 11:14:50 -07:00
Andrew Gerrand
c21a767b2c go.tools/dashboard/app: reject /commit requests from old builders
This is so that we don't corrupt our commit history with reports
from old builders, after the migration to the latest build dashboard.

LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/130300043
2014-08-20 21:45:01 +10:00
Dmitriy Vyukov
5d476c5293 dashboard/app: dedup changes in UI
Currently for every benchmark/metric we show all changes for all builders x procs.
With 4 builders and 5 procs, that's 20 changes (20 red/green boxes in a single cell).
Instead show only maximum change for every benchmark/metric.
This significantly reduces clutter in UI.
When you click on the red/green box, you can see the rest of the changes.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/126430043
2014-08-20 13:24:05 +04:00
Dmitriy Vyukov
1d2a500105 dashboard/app: allow to gob-encode PerfChange
Currently appspot logs say:
delay: gob encoding failed: gob: type build.PerfChange has no exported fields
And I was thinking why it is not sending mails...

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/125480043
2014-08-20 13:20:12 +04:00
Francesc Campoy
e8a1924bfb html2article: Ignore empty anchor elements and obtain the original url from Google Docs
LGTM=adg
R=adg, campoy
CC=golang-codereviews
https://golang.org/cl/127560043
2014-08-19 17:55:46 -07:00
Dmitriy Vyukov
f579fb3656 dashboard/app: eliminate more flakes
Currently we still see some flakes on perf dashboard (e.g. sys-stack is quite frequent).
I am planning to run real perf builder with 5 different values of GOMAXPROCS,
so we can require 3 builders to agree on a change instead of 2.
This will provide 20x improvement in flake detection.
At the same time lower noise bar from 1.2 to 1.1, as I see some real perf changes gets ignored as noise.

All these magic numbers affect only representation of data, but not the data stored in DB.
So we can continue freely tuning them later. There are no significant risks here.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/127520044
2014-08-19 16:22:27 +04:00
Andrew Gerrand
92eb99d907 go.tools/dashboard: fix various small UI issues
- stop time column from wrapping,
- fix pagination on front page,
- left-align pagination buttons.

LGTM=dvyukov
R=dvyukov, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/126410043
2014-08-19 20:43:50 +10:00
Alan Donovan
845abca4e3 go/types/typeutil: Dependencies utility returns transitive closure of import graph.
(Used by forthcoming 'singlefile' command.)

+ Test.

LGTM=bwkster, gri
R=gri, bwkster
CC=golang-codereviews
https://golang.org/cl/130100043
2014-08-18 22:31:56 -04:00
Josh Bleecher Snyder
cc1e254c18 go.tools/astutil: delete all matching imports in DeleteImport
Fixes golang/go#8459.

LGTM=crawshaw, bradfitz
R=bradfitz, crawshaw
CC=golang-codereviews
https://golang.org/cl/128220043
2014-08-14 11:51:51 -07:00
Alan Donovan
f13ba78920 go.tools/go/loader: make error message for massive failure (e.g. no "fmt") more concise.
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/126080043
2014-08-14 12:10:34 -04:00
Andrew Gerrand
c98886f21f go.tools/dashboard/builder: use https to talk to dashboard
LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/125100043
2014-08-13 10:54:52 +10:00
Andrew Gerrand
2607e9b47a go.tools/dashboard/app: add go.sys to builder package list
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/129030043
2014-08-13 07:55:36 +10:00
Andrew Gerrand
573fa9f0bd cmd/cover: show file coverage in HTML drop down
As requested on Stack Overflow: http://goo.gl/ams9fY
(Kudos to sberry for his JavaScript solution, provided there.
This change does the same thing on the server side.)

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/127030043
2014-08-12 09:22:11 +10:00
Alan Donovan
cd6b8ab06d go.tools/go/ssa: improvements to CreateTestMainPackage.
(1) support Example functions defined in programs that don't
    import "testing".  We emit code to testmain.main() to call
    them directly, since we can't call testing.Main.

(2) expose a FindTests function which reports the set of
    Test, Example and Benchmark functions it finds.
    Certain clients need this.

Added test for logic in FindTests.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/115290048
2014-08-08 14:47:16 -04:00
Robert Griesemer
8ce35843de go.tools/go/types: handle all receiver errors in go/types
Pending parser change in CL 123010044.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/125830043
2014-08-07 12:45:28 -07:00
Alan Donovan
3bbc63016b go.tools/go/loader: report parser errors too.
Previously these were recorded in the PackageInfo, but not
reported to the user's error handler (types.Config.Error),
which is typically what prints them.

Minor subtlety: that function must now be able to handle error
values that are not of type types.Error.

+ Test (and renamed it).

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/121290043
2014-08-07 12:50:15 -04:00
Alan Donovan
d3f2df4854 go.tools/go/ssa/interp: some fixes to tests
- Break out parts of coverage.go into more specific files.
- Re-enable test of nil interface-to-interface conversion.
- Update initorder test to reflect spec ambiguity and gc vs go/types variance.
- Re-enable test dependent on now-fixed bug 8189 ("value,ok" yields an untyped bool)

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/119530043
2014-08-07 10:57:00 -04:00
Francesc Campoy
11569f39ea go.tools/cmd/present: track page views for every slide.
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/124720043
2014-08-05 16:02:39 -07:00
Robert Griesemer
b31dcd1655 go/types: comma-ok expressions return untyped boolean as 2nd result
Per acceptance of https://golang.org/cl/112320045/ .

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/113990043
2014-08-05 11:34:36 -07:00
Francesc Campoy
82b913fb17 playground: add ctrl-enter shortcut for gofmt (as in the tour)
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/120420044
2014-08-04 15:55:39 -07:00
Francesc Campoy
cf8082eec5 go.tools/playground: return a better message for code starting with a shebang on non local mode
LGTM=adg, dan.kortschak
R=adg, dan.kortschak, campoy
CC=golang-codereviews
https://golang.org/cl/119160043
2014-08-01 15:04:49 -07:00
Alan Donovan
149e030318 go.tools/cmd/ssadump: print packages and functions to stdout, not stderr.
And serialize the printing of each item with a mutex.
It is the formatted output of this tool, after all.

Also: minor doc tweaks.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/114620044
2014-08-01 14:44:37 -04:00
Alan Donovan
4228ee8063 go.tools/go/ssa: improve printing of anonymous functions.
Examples:
- "foo$1" becomes "pkg.foo$1"
- "init$1" (meaning the first declared "init" function) becomes "init#1",
   to distinguish it from "init$1" (meaning the first anonymous function
   within the synthetic "init" function that initializes package-level vars).

It is now an invariant that all source-level (non-synthetic)
functions have distinct names, and that all names include the
enclosing package.  Added test for this.

+ updated various clients.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/122750043
2014-07-31 17:37:41 -04:00
Alan Donovan
b419465131 go.tools/go/ssa: print types package-relative in all instructions.
It was missing from the four conversions and the Make* instructions.

(Experiments with pure bytes.Buffer-based printing were not faster; various TODOs removed.)

LGTM=crawshaw
R=gri, crawshaw
CC=golang-codereviews
https://golang.org/cl/58040043
2014-07-31 16:29:47 -04:00
Alan Donovan
31c2077fe3 go.tools/go/ssa: rename promote.go and split into two files, {methods,wrappers}.go.
Also:
- move shared utilities to util.go.
- rename types.Selection vars.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/113550043
2014-07-31 16:28:34 -04:00
Josh Bleecher Snyder
3442faf3c1 go.tools/imports: go/format outbound code
Fixes golang/go#8035.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews, shurcool
https://golang.org/cl/120840044
2014-07-28 17:15:17 -07:00
Andrew Gerrand
8aabc9a084 go.tools/godoc: drop scheme from links
golang.org now serves HTTPS,
so the scripts should work
with either HTTP ot HTTPS.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/111640043
2014-07-25 10:27:31 +10:00
Alan Donovan
935700a081 go.tools/go/loader: apply DisplayPath to working directory of cgo tool.
This transforms the virtualized directory (build.Context).Dir to a physical one,
for proprietary build systems that distinguish them.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/116230043
2014-07-24 14:12:52 -04:00
Alan Donovan
9ffbf29971 go.tools/go/ssa: add hook to testmain.go for proprietary (non-'go test') build systems.
Users need only add an extra file to the package to specify
additional imports and initialization steps in testmain, to
match their build system.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/120090043
2014-07-23 15:37:37 -04:00
Chris Manghane
129869a1a6 go.tools/dashboard: don't do method calls or field lookups on a possibly nil repo
LGTM=mischief, adg
R=adg, mischief
CC=golang-codereviews
https://golang.org/cl/106660043
2014-07-23 10:22:29 -07:00
Alan Donovan
b5528ca070 go.tools/go/pointer: add test file missing from CL 112610043 (rev 32ae05502022)
TBR=gri
R=gri
CC=adg, golang-codereviews
https://golang.org/cl/111580043
2014-07-23 12:28:56 -04:00
Andrew Gerrand
63db0771ef go.tools/godoc: fix search heading anchors
Right now they're all "Global" so you can't click use the table of
contents headings for "Types", "Functions", and "Methods".

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/118100043
2014-07-23 09:59:58 +10:00
Alan Donovan
e5d15a9781 go.tools/go/pointer: add intrinsic for time.startTimer, which is implemented in C.
Without it, no value appears to be sent on NewTicker/NewTimer channels.

+ test

Also:
- add (callgraph.Edge).{Description,Pos} convenience methods
  to simplify client code when Site==nil.

LGTM=gri
R=gri, friestein68503
CC=golang-codereviews
https://golang.org/cl/112610043
2014-07-22 18:30:06 -04:00
Alan Donovan
f9612295cb go.tools/oracle: pointsto: if the queried expression is an lvalue, use the type of its value, not its address.
(Probable regression caused by recent changes to VarValue.)

+ regression test.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/116160044
2014-07-22 18:29:56 -04:00
David Symonds
105b764ad0 benchcmp: Fix invocation instructions.
`go test` takes -run and -bench; the -test.run and -test.bench flags
are only for the test binary itself.

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/113390043
2014-07-22 17:50:39 +10:00
Keith Randall
562b65fda7 vet: LEA* opcodes don't need to have matching length source and destination.
LGTM=rsc
R=golang-codereviews, khr, rsc
CC=golang-codereviews
https://golang.org/cl/117950044
2014-07-21 21:15:39 -07:00
Alan Donovan
cd61993a08 go.tools/go/types: move {Type,Object}Of methods from *loader.PackageInfo to *types.Info
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/113750044
2014-07-17 15:10:29 -04:00
Alan Donovan
514bdfb1b7 go.tools/go/ssa: improve generated code for addressable expressions.
If an expression is addressable, we compute its address then load, rather than
extracting the value of subelements.  For aggregates this avoids large copies.
Example:
        var x [2]struct{y [3]int}
        print(x[1].y[2])

Was:
t0 = local [3]struct{x [5]int} (x)                 *[3]struct{x [5]int}
t1 = *t0                                            [3]struct{x [5]int}
t2 = t1[1:int]                                         struct{x [5]int}
t3 = t2.x [#0]                                                   [5]int
t4 = t3[2:int]                                                      int

Now:
t1 = &t0[1:int]                                       *struct{x [5]int}
t2 = &t1.x [#0]                                                 *[5]int
t3 = &t2[2:int]                                                    *int
t4 = *t3                                                            int

Also:
- make emitFieldSelections responsible for calling emitDebugRef, as
  one of its two calls was forgetting to do it.
- relax the specification of (*Program).VarValue because not all
  subexpressions are materalized as values now.
- fix up the objlookup.go test expectations to match.

go/ssa/interp test runs 10% faster.

Thanks to Peter Collingbourne for pointing this out.

LGTM=pcc
R=pcc, gri
CC=golang-codereviews
https://golang.org/cl/109710043
2014-07-17 15:06:09 -04:00
Robert Daniel Kortschak
09286920ba go.tools/cmd/present: move jquery ui code into static
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/118760043
2014-07-16 16:33:46 +10:00
Andrew Gerrand
cc0b856ebe go.tools/godoc/static: remove unnecessary mainframe wrapper
Fixes golang/go#8300.

LGTM=adonovan
R=golang-codereviews, adonovan, bradfitz
CC=golang-codereviews
https://golang.org/cl/113130044
2014-07-16 09:39:11 +10:00
Alan Donovan
b2ea2e8560 go.tools/go/ssa: permit "for range x"
+ test

Also: don't generate init() functions for packages loaded from export data.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/111200043
2014-07-15 17:34:50 +01:00
Robert Griesemer
e078800d1f go/types: permit "for range x"
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/110630044
2014-07-15 08:54:09 -07:00