https://golang.org/cl/37694 is a backwards-incompatible change to the
go/types API that causes "unsafe" to be included among the results of
(*types.Package).Imports(). Client packages such as go/loader and
go/ssa now need to recognize the special unsafe package and its
unusual *Bultin members and not create a types.Package for it.
Change-Id: I902725d3053cb887246978efdb5ec5dcdc0e4818
Reviewed-on: https://go-review.googlesource.com/37710
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I193ddd265673f133a489d268629b94be693a8dbc
Reviewed-on: https://go-review.googlesource.com/37606
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: Ib8acac744a171b70f3f842f8f5f8c34064869383
Reviewed-on: https://go-review.googlesource.com/37604
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I1dc8e4dbfd784bb22b2f0dabb7c1a08cf1ef44ee
Reviewed-on: https://go-review.googlesource.com/37603
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: Ifd1ed4005eec55cebfd5c0d0519b8af328fcc470
Reviewed-on: https://go-review.googlesource.com/37601
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: Ied3a906269ca7782071428eeb1764b3b863576a2
Reviewed-on: https://go-review.googlesource.com/37600
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I3db2aad14de33f0be69569cd355e453173098358
Reviewed-on: https://go-review.googlesource.com/37599
Reviewed-by: Alan Donovan <adonovan@google.com>
This reverts commit 79902b439b.
Reason for revert: build broken on some platforms.
Change-Id: I5ceddc305580ff97f47ae27da831f99e96dab424
Reviewed-on: https://go-review.googlesource.com/37539
Reviewed-by: David R. Jenni <david.r.jenni@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: Iabfa1e9926e097ba11d1db0a2d785fec70ce3997
Reviewed-on: https://go-review.googlesource.com/37609
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I4a39f337a266e14f0188d32cf89a7e19718e0ded
Reviewed-on: https://go-review.googlesource.com/37630
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I54dab41d423050b883a3af1f5bb8c5119e2b7100
Reviewed-on: https://go-review.googlesource.com/37602
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: I68b4af07cc64a46f5794a0e339859f4d6bc9dad1
Reviewed-on: https://go-review.googlesource.com/37605
Reviewed-by: Alan Donovan <adonovan@google.com>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: Iad26e1ae1dbeb29a3223279eccc4ba6f6bb48bd6
Reviewed-on: https://go-review.googlesource.com/37631
Reviewed-by: Alan Donovan <adonovan@google.com>
The previous "dead φ" check was simple and naive but left cycles of
dead φ-nodes. This confused some downstream static analysis tools.
This change makes the φ-nodes liveness check transitive.
+ Test.
Also, number phi nodes so they're not all called t0 during debugging.
Reduces memory consumption by 1%.
Increases execution time by <1%.
Change-Id: I2908662c1478d455fdf4a179f4a12d6184a456c0
Reviewed-on: https://go-review.googlesource.com/37157
Reviewed-by: Robert Griesemer <gri@golang.org>
As noted by griesemer in golang/go#18799, this doesn't address the issues
raised in golang/go#11415 because when checking an xtest package the
corresponding package is assumed to have been installed. This
however is similar to the assumptions made by go vet (raised
as an issue in golang/go#16086). So whilst not perfect, it will probably
suffice until golang/go#11415 is resolved.
Fixesgolang/go#18799
Change-Id: I1ea005c402e5d6f5abddda68fee6386b0531dfba
Reviewed-on: https://go-review.googlesource.com/36992
Reviewed-by: Robert Griesemer <gri@golang.org>
Previously, field names in composite literals were treated as normal
identifiers. For example, in Foo{X: 42}, X was treated link a normal
variable and was linked to "#X".
With this change, field links now include a prefix for their type
definition, for example, "#Foo.X".
Fixesgolang/go#16031
Change-Id: I9cb501704f284fbbc05424555312307c61843e47
Reviewed-on: https://go-review.googlesource.com/36830
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
godoc formats function examples for text or HTML output by
stripping the surrounding braces and un-indenting by replacing
"\n " with "\n". This modifies the content of string literals,
resulting in misleading examples.
This change introduces a function, replaceLeadingIndentation, which
unindents more carefully. It removes the first level of indentation
only outside of string literals. For plain text output, it adds custom
indentation at the beginning of every line including string literals.
Fixesgolang/go#18446
Change-Id: I52a7f5756bdb69c8a66f031452dd35eab947ec1f
Reviewed-on: https://go-review.googlesource.com/36544
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Tip introduces a new internal/poll package that breaks the expected
output.
Fixesgolang/go#19150
Updates golang/go#19152
Change-Id: I5ff7e8a92afe4d25feb6365933062e931c9b435f
Reviewed-on: https://go-review.googlesource.com/37148
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Right now, clicking around packages in the godoc web interface strips
the URL of any query strings it may have, which makes traversing
internal packages a clumsy experience (constantly have to re-add ?m=...).
This revision preserves the ?m=... flag in links between packages by examining
the current PageInfoMode and converting it to a query string.
Change-Id: I4e28279d8cbf221bcc7d5bce8de04c90cc907678
Reviewed-on: https://go-review.googlesource.com/34982
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Details:
- remove go1.5 "default version" labels on most files
- remove go1.6 labels on a few files
- go/loader: use conf.Cwd not "." in a couple places; update faulty
test expectations. (Not sure why this wasn't caught sooner.)
- go/ssa/interp: add 'mono' result to time.now intrinsic
- go/gcimporter15/bimport.go: make consistent with the version in gc
- go/ssa/interp: update test error message
- go/ssa: update a comment
The go/gcimporter15/bexport.go logic is stale and needs to be brought
up to date. Needs a separate CL since it's tricky.
Tested on go1.6, go1.7, go1.8.
Change-Id: I841189d30e131b7c49a4e8690ea7c40b55041bae
Reviewed-on: https://go-review.googlesource.com/36540
Reviewed-by: Robert Griesemer <gri@golang.org>
If enabled (via the "enableShortcuts" option), Ctrl+S/Cmd+S now
saves/shares the playground snippet and initiates a download.
Credit to Alexander Kucherenko (see golang.org/cl/35950).
Updates golang/go#15378.
Change-Id: I8a2d733c25e4c95787fbe1f5ac00fa1befbb4693
Reviewed-on: https://go-review.googlesource.com/36486
Reviewed-by: Andrew Gerrand <adg@golang.org>
Fixes two problems with adding the #StructType.FieldName anchors for
linkified struct fields:
* the old code was quadratic
* the old code only dealt with ASCII only
Change-Id: If03a367a94d05d3d470e1326dfb573037088ff78
Reviewed-on: https://go-review.googlesource.com/35486
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This change remove an unnecessary string conversion of
a variable that is already a string.
Change-Id: I64d9a6c059276fa22f1be9f2dba02bbeb63cb8fb
Reviewed-on: https://go-review.googlesource.com/35560
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is essentially a copy of the changes in https://golang.org/cl/35268/
but with Go1.9 specific tests factored out into a separate file with build
tag.
For golang/go#18130.
Change-Id: I235693e1bc6145bb53bfd3b343647704c8e82e61
Reviewed-on: https://go-review.googlesource.com/35269
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
- bimport.go is a 1:1 copy of the respective version in the std
library: $GOROOT/src/go/internal/gcimporter/bimport.go .
- bexport.go is mimicking the respective code in the cmd/compile.
- isAlias18/19.go are needed because types.TypeName.IsAlias does
not exist before Go 1.9.
Tested against Go 1.6, 1.7, 1.8, 1.9 (dev.typealias branch).
For golang/go#18130.
Change-Id: Ic46c5850923fab2a35d4dc33850f2b0667c30398
Reviewed-on: https://go-review.googlesource.com/35104
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Currently both "testUnix" and "testWindows" elements are shown simultaneously.
This change detects the correct platform to hide/show the appropriate
elements based on the viewer's browser.
Change-Id: I3afee7507d61b2d756127166caede85adcd531b8
Reviewed-on: https://go-review.googlesource.com/35103
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>