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
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
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
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
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
`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
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
PackageInfo:
- deleted IsType
- inlined + deleted: ValueOf, TypeCaseVar, ImportSpecPkg
- on failure, TypeOf accessor now returns nil (was: panic)
go/ssa: avoid extra map lookups by using Uses or Defs directly when safe to do so,
and keeping the TypeAndValue around in expr0().
LGTM=gri
R=gri, pcc
CC=golang-codereviews
https://golang.org/cl/107650043
The InitOrder needs to be reset.
+ Test.
This bug manifested itself in duplicate HTML in the godoc -analysis view,
e.g. "f((x)" or "funcfunc f()"
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/107660044
This extends the sanity checker to identify and report referrers
which do not appear in the function's instruction lists, and fixes two
bugs in the lifting algorithm which were caught by the sanity check.
LGTM=adonovan
R=adonovan
CC=axwalk, golang-codereviews
https://golang.org/cl/110210045
We introduce a method (*Interface).Complete(), which is intended
to be called from clients after all embedded interfaces have been
fully defined. For importers, this will definitely be the case
after the import has finished, so each importer have been updated
to do so, with the exception of the gcimporter, which does not use
embedded interfaces, therefore Complete() can be called immediately
after construction.
Building the method set separately from the constructor type caused
some problems with go/importer, which copies the types.Interface
object, leading to there existing two almost-identical interface
types referenced from interface method receivers, only one of which
has been completed. To avoid this situation, the importer has been
modified to construct the interface object only once.
Fixesgolang/go#8177.
LGTM=gri
R=gri, dave, gordon.klaus, adonovan
CC=golang-codereviews
https://golang.org/cl/105060044
Also:
- declare PackageInfo, FileInfo types to simplify API.
- update docs:
eliminate this TODO item
document improved analysis times
state that -analysis=pointer implies -analysis=type
LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/112770044
This logs all successful handshakes and all requests to run code snippets;
it is not immediately obvious how to limit this to non-localhost hosts, or
to instances where publicly available playgrounds are allowed without resorting
to addition of a new global. The level of noise on the log should not be too
great.
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/112850043
This change allows the directory front page to be more easily configurable.
Templates are now read only at start-up and stored in a map rather than re-parsed for each page rendering.
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/109080044
This method was deemed unfit for the API. See the original CL for discussion.
««« original CL description
go.tools/go/loader: Add Program.FilePath convenience method for getting the full path of a source file.
LGTM=gri
R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/107160049
»»»
LGTM=gri
R=gri, adonovan
CC=golang-codereviews
https://golang.org/cl/107570043
text/tabwriter cells are tab-terminated, not tab-separated. This creates trailing whitespace. However, with left-aligned columns, it is ok not to treat the final element as a cell. Demo: http://play.golang.org/p/m_ajG8SSZe
LGTM=gri
R=golang-codereviews, gobot, gri
CC=golang-codereviews, r
https://golang.org/cl/103650043
This CL introduces two vet checks. Statistics and code below are from a recent 50mb corpus of public code.
1. Check for redundant conjunctions and disjunctions. This check caught 26 instances, of which 20 were clearly copy/paste bugs and 6 appeared to be mere duplication. A typical example:
if xResolution < 0 || xResolution < 0 {
panic("SetSize(): width < 0 || height < 0")
}
2. Check for expressions of the form 'x != c1 || x != c2' or 'x == c1 && x == c2', with c1 and c2 constant expressions. This check caught 16 instances, of which all were bugs. A typical example:
if rf.uri.Scheme != "http" || rf.uri.Scheme != "ftp" {
rf.uri.Scheme = "file"
}
Fixesgolang/go#7622.
LGTM=rsc, r
R=golang-codereviews, jscrockett01, r, gri, rsc
CC=golang-codereviews
https://golang.org/cl/98120043
This builtin is a little weird in this form as it is (to my knowledge)
the only function that takes a variadic argument of non-slice
type. The language provides no syntax to express this, so we pick
a stringification for such arguments that does not appear in the
language. Specifically, use T... instead of ...T to distinguish it
from the normal case where the type is a slice.
This change lets the go/ssa package produce more efficient IR by
avoiding an extra conversion of the second argument.
LGTM=gri
R=gri
CC=adonovan, golang-codereviews
https://golang.org/cl/108230044
Currently performance builders crash with:
hg log: unmarshal Mercurial log: XML syntax error on line 4991: illegal character code U+001B
R=adg
CC=golang-codereviews
https://golang.org/cl/110060046
Really two fixes: Don't panic on bad instructions and don't complain about commented out instructions.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/110070044