This is now allowed in go1.8.
Fixesgolang/go#19646.
Change-Id: Iece4fd2a881144bdbe841e0a26ba4348d6b8828e
Reviewed-on: https://go-review.googlesource.com/38452
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
DeleteNamedImport assumes the import declaration is in the form of:
import (
"foo"
)
If an import path is deleted there might be a blank line-sized hole:
import (
)
It'll merge the black hole with the last line to change it to:
import (
)
However the import declaration might be in the following form as well:
import (
"foo")
Whic means after deleting the import path, it changes to:
import (
)
In this case it still tries to merge the line with a non existing line,
causing token.File.MergeLine to panic.
We fix the issue by checking that the import path line is not the last
line to avoid panicing.
Fixesgolang/go#20229
Change-Id: I37537a4eaa83d14db59a2926d7bb14c27167a2e4
Reviewed-on: https://go-review.googlesource.com/44372
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
In the go/doc, the same map as "predeclared" is defined.
Instead of the "predeclared" map use the "IsPredeclared" function
which is an accessor for the go/doc map.
Deleted unnecessary "predeclared".
Fixesgolang/go#20357
Change-Id: I7fdf42cfeb4440fb490be9380f39035be88f9a5a
Reviewed-on: https://go-review.googlesource.com/43473
Reviewed-by: Kevin Burke <kev@inburke.com>
The link of the function declaration part is unnecessary because it points to the same place.
Removed the link of the function declaration part.
"IdentMode" has been removed since it is no longer used.
Fixesgolang/go#20269
Change-Id: I6399899947e46dc84c5432c1d645f6d96b7db4f6
Reviewed-on: https://go-review.googlesource.com/42892
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This mostly reverts commit 1c59bc354d
(CL 43350) which had fixed Go tip but broken Go 1.7 and Go 1.8
builders.
Change-Id: I4e7bdfafde74c9e730bb870b9db05b663b4f56a3
Reviewed-on: https://go-review.googlesource.com/43391
Reviewed-by: Alan Donovan <adonovan@google.com>
http://golang.org/cl/41476 added the internal/cpu package
to unify cpu feature flag detection in the standard library.
Add a replacement for the assembler function internal/cpu.cpuid
that simulates a x86 cpu with no feature detection capabilities.
Remove bytes.init and strings.init from the external function list
because they do not depend on assembler functions anymore.
Remove hash/crc32.haveSSE42 and math.hasSSE4 because they
have been removed from the go standard library.
Change-Id: Icab6ed3cb13eb14b28d23f2b9c5ae94688f2dc95
Reviewed-on: https://go-review.googlesource.com/43350
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Updates golang/go#19906
Change-Id: If13c828541cdb3937e5e970dd8add7615d36d866
Reviewed-on: https://go-review.googlesource.com/40171
Reviewed-by: David R. Jenni <david.r.jenni@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
The GOROOT of whatever tool build toolstash is irrelevant. We want
the goroot of the "go" command we're testing.
Change-Id: Ie7e11c74cb445ea694d88c743dbc239a55d47864
Reviewed-on: https://go-review.googlesource.com/43033
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The "go" command is a random "go" in the environment, not
necessarily the one under test. Use the go command in the
goroot we're testing.
This CL removes the need to add $GOROOT/bin to your path
before running compilebench.
Change-Id: Ieb7f441f8287105e13446006e73b760d80e51e03
Reviewed-on: https://go-review.googlesource.com/42932
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
importPath and srcDir are both of string type.
Change-Id: Ia5230bd19ea83bc210cb0b1a50046e4e0ef2accb
Reviewed-on: https://go-review.googlesource.com/42890
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
go-mode does not use go-mode-load now.
Need to use go-mode-autoloads instead.
Change-Id: I3ee2113b41972a1f700d604ea7a6c2d5b59da8bb
Reviewed-on: https://go-review.googlesource.com/42193
Reviewed-by: Alan Donovan <adonovan@google.com>
Manually apply same change as CL 41822 did for cmd/go/internal/get,
but for golang.org/x/tools/go/vcs, to help keep them in sync.
Updates golang/go#18660.
Helps golang/go#11490.
Change-Id: I6c7759c073583dea771bc438b70f8c2eb7b5ebfb
Reviewed-on: https://go-review.googlesource.com/42017
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This reverts commit 3aa1caa08a.
Reason for revert: benchstat is preferred to benchcmp
Change-Id: I9772eb342fb631a68511986d832bb1444766afdc
Reviewed-on: https://go-review.googlesource.com/42027
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This package has been moved since then.
Change-Id: Ibf0044cf4fcef47ae15301c2880ff129a8829516
Reviewed-on: https://go-review.googlesource.com/41856
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
A go/build change in Go 1.9 (CL 33158) allowed for a better expected
error message for "nonexistingpkg" case. CL 37768 did that. However,
that shouldn't be done for Go 1.8 and older, since they don't have
the corresponding go/build change.
So, if the version is Go 1.8 or older, allow matching those previous
expected outputs (before CL 37768) for "nonexistingpkg" case.
Move test cases for TestCLI from a package-level variable into TestCLI
itself. This is more readable, and isGo19's value is ready in time.
Fixesgolang/go#20122.
Change-Id: I5e80600a75176d9e54ffebb7730849e381568316
Reviewed-on: https://go-review.googlesource.com/41810
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Backport of CL 41619.
Generated by copying bimport.go and reverting
the chunk containing the "This file is a copy"
comment near the top.
Fixesgolang/go#20121
Change-Id: If24c97d01a550318ab919c37cd0c4a8f34d776c7
Reviewed-on: https://go-review.googlesource.com/41756
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sometimes, as with CL 41493, or when investigating
a reported issue, there's a package of interest
that is not part of the standard compilebench suite.
Add a -pkg flag to allow easy access to the compilebench
set of goodies (allocs, object file stats) without
having to edit and reinstall compilebench itself,
which is what I have been doing.
Change-Id: Id6ca6356cae062208f8686c0cb597ed45fc861c0
Reviewed-on: https://go-review.googlesource.com/41627
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Insert line numbers via a ::before pseudo-element so you can't select
them when you copy text. See the code comment for more information.
Fixesgolang/go#20077.
Change-Id: I24a5b17786a52c8107b4f830e824526ba03bc38d
Reviewed-on: https://go-review.googlesource.com/41418
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(specifically: strings.Count, testing.callerEntry)
The interpreter tests were very useful for finding bugs during
development of go/ssa but now seem to be all cost and no benefit.
It may be time to delete this package.
Change-Id: I22348be9fb37bb0fd0c572c3e6f57e70fc069e02
Reviewed-on: https://go-review.googlesource.com/40871
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
godoc once again adds anchors for variable and constant
declarations. Individual declarations and lists of declarations are
both covered.
Fixesgolang/go#19894
Change-Id: If5f8f0c3429774f33535e2e654685ba5d71937f1
Reviewed-on: https://go-review.googlesource.com/40300
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
And avoid assumptions about the contents of the standard hash/fnv
package.
Change-Id: I10cc95ac6e3b482da5b027d68ff218d08f425e89
Reviewed-on: https://go-review.googlesource.com/40870
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This means that running stringer should always
have the intended effect, without having to
go install the package first, which was a common
source of confusion.
The source importer is marginally slower,
but stringer is run infrequently,
and we're only typechecking one package (and fmt),
not an entire tree, as vet does.
Fixesgolang/go#10249
Change-Id: Ib8cde29bd6cc596964dbe7348065932dd59075fc
Reviewed-on: https://go-review.googlesource.com/40403
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Robert Griesemer <gri@golang.org>
The GOPATH environment variable is defined at
https://golang.org/cmd/go/#hdr-GOPATH_environment_variable as:
> The GOPATH environment variable lists places to look for Go code. On
> Unix, the value is a colon-separated string. On Windows, the value is
> a semicolon-separated string. On Plan 9, the value is a list.
It is legal for Go packages to be in any of those places, not only
the first entry. Look in all places for golang.org/x/tools repository.
Cache the directory that is found. It's slightly more expensive
to look for it, since potentially multiple directories must be
checked for existence.
Updates golang/go#19400.
Change-Id: I16661b7149d52ea6168fffc605c842d7a4da009b
Reviewed-on: https://go-review.googlesource.com/38778
Reviewed-by: Michael Matloob <matloob@golang.org>
Importer "source" does not exist in Go 1.8, so this means that
default usage of gotype is broken in that compiler version.
Change-Id: I517520b0cac7c62a3e213d0647a3d621e8ced58c
Reviewed-on: https://go-review.googlesource.com/40091
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
In some cases walkFn is being called after the fastWalk function has
returned. This often happens when an error was encountered early on in
scanning directories with many entries.
It is caused by fastWalk not waiting for its workers to complete their
work. A sync.WaitGroup is used to wait for all workers to finish when
the function returns.
Updates golang/go#16399
Change-Id: I695d30c18e4878b789520b9d8a650f9688d896ac
Reviewed-on: https://go-review.googlesource.com/40092
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Apparently there was a typo during initial import,
and compilebench was placed at the top level,
rather than in the cmd subdirectory. Oops. Fix that.
Change-Id: Ibea9ed132dca26c022ea02933defec9534105f18
Reviewed-on: https://go-review.googlesource.com/39792
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When the -count flag is provided,
instead of having each run overwrite the previous profile,
add a count suffix to the profile filename.
Then you can combine the profiles with
go tool pprof `go tool -n compile` <all profile files here>
This allows generation of precise profiles,
even for fast-compiling packages.
Change-Id: I006cf8fad143346b28a646a0b3582cc0f6eec310
Reviewed-on: https://go-review.googlesource.com/39718
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Instead of running make.bash, run 'go build -a std cmd'.
Change the benchmark name to reflect this.
This does roughly the same task, namely compile and link
all the code in the tree, but with several advantages:
* It works cross-platform.
* It is a bit faster, while measuring the same fundamentals.
* It doesn't measure how fast the bootstrap compiler works,
which is irrelevant.
* If interrupted, it leaves the current Go installation
in a usable state.
Change-Id: I469b1d032b48b06e3dea021bd031283bc3a16ff4
Reviewed-on: https://go-review.googlesource.com/39714
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
There's a surprising amount of variety
in the drivers of compilation speed.
It's helpful to have a variety of packages here.
For example, archive/tar exhibits golang/go#19839
much more than the others.
Change-Id: If66b332d63427fb246305cb14cfee9ef450bcdcf
Reviewed-on: https://go-review.googlesource.com/39713
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This CL is an import of compilebench from rsc.io/compilebench
at commit 1a5bec7724500bd6df47e053dbc42b41fe653372.
This CL brings in only main.go, unaltered.
The other files were:
* LICENSE: now unnecessary
* README.md: now unnecessary
* compilecmp: still available at its original home,
soon to be superceded by a new tool in x/tools
Once compilecmp is available in x/tools,
I will replace rsc.io/compilebench with a breadcrumb repo.
All outstanding pull requests against rsc.io/compilebench are from me.
They will be closed, and new CLs sent here as appropriate.
Change-Id: Ic436abf4a662173c6c184bc765b1b9cab13b3cfb
Reviewed-on: https://go-review.googlesource.com/39712
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Linking cmd for android requires a cross-compiling toolchain,
which is not standard fare.
Skip it, and trust that the other platforms will pick up the slack.
Change-Id: Ifcf74f77e98489c859805ab7a448d80d019f3d20
Reviewed-on: https://go-review.googlesource.com/39556
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
At some point we switched tip.golang.org to run in GKE, which
terminates TLS directly on port 443. This requires a new technique
for detecting a plain HTTP connection. In addition we may want to run
talks.golang.org on App Engine Flex, which uses an X-Forwarded-Proto
header to indicate HTTP, so let's prepare for that possibility.
Fixesgolang/go#19759.
Change-Id: Iddc567214c5d28f61c405db065aa1b3f2c92fd85
Reviewed-on: https://go-review.googlesource.com/38800
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Change-Id: Ia12ff7a0f6898f8d140565d255793904ce8585c4
Reviewed-on: https://go-review.googlesource.com/38754
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Change-Id: Ie19a60595862c0afff9364ee21dd9598370e6c91
Reviewed-on: https://go-review.googlesource.com/38752
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>