Commit graph

37392 commits

Author SHA1 Message Date
Bryan C. Mills a1cbbe0de6 cmd/go/internal/modload: report errors explicitly from Lookup
Previously, we reported errors directly in (*loader).load via base.Errorf.
Unfortunately, (*loader).load can be called from contexts in which such errors
should not be considered fatal, such as by load.PackagesAndErrors.

Instead, we save the errors in pkg.err and modify Lookup to return that error.

This change is a bit awkward: we end up suppressing a "no Go files" error for
packages at the root of newly-imported modules, even if they really do contain
source files. I believe that that's due to a special-case lookup for modules in
the build list, which allows us to "validate" imports for modules in the build
list even though we haven't actually downloaded their sources (or verified that
they actually contain the requested package). The fix for that issue is in the
change that follows this one.

Fixes #26602.

Change-Id: I16f00ceb143fbb797cfc3cb07fd08aeb6154575b
Reviewed-on: https://go-review.googlesource.com/127936
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-09 21:00:06 +00:00
Rebecca Stambler 79bf7955dc go/types: fix errors in recording type information
In my previous change, I didn't use the correct functions for continuing
to record type informations after errors. Change to using the correct
functions, and add a comment to clarify in expr.go.

Updates #22467

Change-Id: I66ebb636ceb2b994db652343430f0551db0050c3
Reviewed-on: https://go-review.googlesource.com/128835
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-09 20:13:38 +00:00
Bryan C. Mills 28cee7075e cmd/go: test that 'go get pkg@version' installs pkg
This test passes, but it encodes several behaviors that I think are bugs.
I suggest that we check it in as-is, and we can update it as the bugs are fixed.

Change-Id: Icb073de9cb13036dbccadb4ff2cb3169ffb56236
Reviewed-on: https://go-review.googlesource.com/128137
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-09 19:59:46 +00:00
Bryan C. Mills a618efd7d8 cmd/go: add test for 'go get' within a local module
Change-Id: I16d36c8e22c84a3266520d86e41ff71ef826ae70
Reviewed-on: https://go-review.googlesource.com/128555
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-09 19:51:47 +00:00
Bryan C. Mills 8c0fd83f72 cmd/go: add test cases for 'go list' with bad import paths
Change-Id: I45a675c5f699b23284a2a50b33cb22882f4b3b80
Reviewed-on: https://go-review.googlesource.com/128016
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-09 18:40:14 +00:00
Bryan C. Mills 79fe6f9854 cmd/go: fetch history as needed to resolve recent tags
Fixes #26713.

Tested with Git 2.7.4. Older Gits may or may not work.

Change-Id: Ib72d751388dfbb50030191ae40f788d1402834b2
Reviewed-on: https://go-review.googlesource.com/126956
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-09 18:34:25 +00:00
Daniel Martí c116265eb3 go/printer: make empty lines break table alignment
In previous versions of Go including 1.10, an empty line would break the
alignment of elements within an expression list.

golang.org/cl/104755 changed the heuristic, with the side effect that
empty lines no longer broke the table alignment.

Reintroduce the behavior and add a regression test for it.

Fixes #26352.

Change-Id: I410bcff4cba25c7f8497d46bd7890a2c7ee11d46
Reviewed-on: https://go-review.googlesource.com/125260
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2018-08-09 18:17:00 +00:00
Filippo Valsorda 666de6c9c4 A+C: first round of automated updates for Go 1.11 and missing AUTHORS
One first round of low-hanging fruit, excluding anything unclear.

Also fixed a bug where, if a contributor had different emails under
different CLAs, only the first one was added to AUTHORS.

Updates #12042

Change-Id: Id7b06c885d74b4718ef2d74d149513a7c0f40c91
Reviewed-on: https://go-review.googlesource.com/126215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-09 18:11:36 +00:00
Mostyn Bramley-Moore f2131f6e0c doc.Example should not worry about unresolved blank identifiers
https://golang.org/pkg/bufio/#example_Scanner_custom is not directly
runnable in the playground via godoc, but if I copy+paste the code into
https://play.golang.org/ then it runs just fine.

This seems to be due to the blank identifier being considered unresolved
in the following line in the example:

_, err = strconv.ParseInt(string(token), 10, 32)

But that's the whole point of blank identifiers- they're not supposed
to be resolved.  So let's skip adding the blank identifier to
doc.playExample's unresolved map.

Fixes #26447

Change-Id: I52bc7d99be1d14a61dc012d10c18349d52ba4c51
GitHub-Last-Rev: 9172e9dc13
GitHub-Pull-Request: golang/go#26448
Reviewed-on: https://go-review.googlesource.com/124775
Reviewed-by: Robert Griesemer <gri@golang.org>
2018-08-08 21:37:36 +00:00
Leigh McCulloch 6b937ace68 doc/contribute: add examples for finding issues on the issue tracker
For contributors looking for new issues to contribute to it can be
difficult to find issues that need a fix and don't already have a fix
being considered. There are several labels that help guide the way
already, like `NeedsFix`, `HelpWanted`. But many issues with this label
will already have a CL. For new contributors this can be especially
difficult.

Fixes #26494

Change-Id: Ifd38ea65e362b4c580207a06f959646e49ac594f
GitHub-Last-Rev: 6d2b54447b
GitHub-Pull-Request: golang/go#26516
Reviewed-on: https://go-review.googlesource.com/125355
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-08 21:12:43 +00:00
Robert Griesemer e7bce08493 go/types: if base type for an alias is known, use it when needed
Because methods are type-checked before the receiver base type
is "complete" (i.e., they are checked as part of the receiver
base type), situations occur where aliases of those base types
are used (in those methods) but the alias types are not known
yet (even though their base types are known).

This fix is a temporary work-around that looks syntactically
for the base types of alias types and uses those base types
when we refer to an "incomplete" alias type. The work-around
is completely localized and guarded with a flag so it can be
disabled at short notice.

The correct fix (slated for 1.12) is to decouple type-checking
of methods from their receiver base types. See issue #26854.

Fixes #26390.

Change-Id: I66cc9d834b220c254ac00e671a137cf8a3da59c1
Reviewed-on: https://go-review.googlesource.com/128435
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2018-08-08 16:54:21 +00:00
Dmitri Shuralyov 884eea6f0a A+C: update Dmitri Shuralyov's emails
Add my current personal email in both A+C, but keep old one too.
Add my @golang.org email to CONTRIBUTORS.

Change-Id: Idba258e465a8d657372dbeb6cb734744d493e5d4
Reviewed-on: https://go-review.googlesource.com/128416
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-08 15:17:53 +00:00
Daniel Martí bc471a52d7 net: reduce TestSplice/big's memory usage
The old code used splice on a 2GB []byte when not in short mode, meaning
that running 'go test net' when one had 4GB or less free memory would
easily result in "out of memory" runtime panics.

Instead, use a much smaller size that is still big enough to not fit
into a single splice(2) syscall. The new size is just 5MB, so the test
uses a fraction of the memory it used to, and there's no longer a need
for a different size on short mode.

This also speeds up the test, which goes from ~1.23s to ~0.01s on my
laptop.

Fixes #26867.

Change-Id: Iae1daa5c0995b549f41992f44339be32ca1ee5e4
Reviewed-on: https://go-review.googlesource.com/128535
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Andrei Tudor Călin <mail@acln.ro>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-08 13:58:37 +00:00
Gn Shivakumar 15c106d993 cmd/go: 3 cmd/go tests (>8s) made as non-short scripts
* TestAtomicCoverpkgAll -> Script/cover_atomic_pkgall.txt and make it
* non-short
* TestCoverpkgAllRuntime -> Script/cover_pkgall_runtime.txt and make it
* non-short
* TestCpuprofileTwice -> Script/cpu_profile_twice.txt and make it
* non-short
* TestGoTestMainTwice -> make it non-short

Updates #26472

Change-Id: I24f3d4c2a8b6e317adb369a1b1426e693f9571ed
Reviewed-on: https://go-review.googlesource.com/126636
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-07 20:33:33 +00:00
Bryan C. Mills a685a8d114 cmd/go: make 'go get <module>@none' idempotent
Before this change, 'go get <module>@none' for a module not in the build list
would add the module to go.mod (with the explicit version string "none").
Subsequent go commands would fail with 'invalid module version "none"'.

Change-Id: Iebcaeab89eb19959f0a9aeda836f179962953313
Reviewed-on: https://go-review.googlesource.com/127215
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-07 18:34:22 +00:00
Bryan C. Mills 9ef5ee911c cmd/go/internal/load: remove unused argument from Lookup
Change-Id: Ia2948a88c6d45a31be17b3d7415559cd53c289ce
Reviewed-on: https://go-review.googlesource.com/128015
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-07 14:36:14 +00:00
Bryan C. Mills 79faf9246e cmd/go/internal/load: pass the importer's package path when checking visibility
A module like "gopkg.in/macaroon.v2" might have a test with a "_test" package
suffix (see https://golang.org/cmd/go/#hdr-Test_packages).
When we compile that test, its ImportStack entry includes the "_test" suffix
even though nothing else can actually import it via that path.
When we look up the module containing such a package, we must use the original
path, not the suffixed one.

On the other hand, an actual importable package may also be named with the
suffix "_test", so we need to be careful not to strip the suffix if it is
legitimately part of the path. We cannot distinguish that case by examining
srcDir or the ImportStack: the srcDir contaning a module doesn't necessarily
bear any relationship to its import path, and the ImportStack doesn't tell us
whether the suffix is part of the original path.

Fortunately, LoadImport usually has more information that we can use: it
receives a parent *Package that includes the original import path.

Fixes #26722

Change-Id: I1f7a4b37dbcb70e46af1caf9a496dfdd59ae8b17
Reviewed-on: https://go-review.googlesource.com/127796
Reviewed-by: Russ Cox <rsc@golang.org>
2018-08-07 14:19:46 +00:00
Bryan C. Mills d893573155 cmd/go: fix outdated comments
Change-Id: I09532546c96b3758f76528fb5010dafc638139b8
Reviewed-on: https://go-review.googlesource.com/128135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-07 14:17:02 +00:00
Richard Musiol a9dcbab0fd syscall/js: extend ValueOf to support arrays and objects
This commits adds []interface{} and map[string]interface{} as quick
ways to create JavaScript arrays and objects. They correspond to the
JavaScript notations [...] and {...}. A type alias can be used for
a concise notation.

Change-Id: I98bb08dbef1e0f3bd3d65c732d6b09e1520026ba
Reviewed-on: https://go-review.googlesource.com/126855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-07 10:56:56 +00:00
Mario Arranz 6d0f757bb9 cmd/asm/internal/arch: add package definition
The package arch didn't have a definition as you can see in https://tip.golang.org/pkg/cmd/asm/internal/arch/

Change-Id: I07653b396393a75c445d04dbae5e22e90a0d5133
GitHub-Last-Rev: a859e9410f
GitHub-Pull-Request: golang/go#26817
Reviewed-on: https://go-review.googlesource.com/127929
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-06 21:16:18 +00:00
Keith Randall 8cc7540ecb doc: describe cgo ptr->uintptr changes for 1.11.
Fixes #26721

Change-Id: Icc4660327a9ba668c88f8d9e0b9f206ba8f6dc27
Reviewed-on: https://go-review.googlesource.com/127975
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-06 17:35:28 +00:00
LE Manh Cuong 870e12d7bf cmd/go: fix go get fail when GIT_TRACE set
GIT_TRACE write message to stderr, while run1 merge both stdout and
stderr. So function which call run1 and rely on its output will failed
to parse the result when run1 success.

By using cmd.Output(), we ensure only cmd standard out is returned.

Fixes #19682

Change-Id: I7002df17fe68aea1860ddc7382c68cc23548bd90
Reviewed-on: https://go-review.googlesource.com/126735
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-06 14:12:24 +00:00
Kevin Burke 5a720d229d cmd/go: fix unnecessary plural
"expanded imports paths" should read "expanded import paths." Run
mkalldocs.sh to pick up other changes which were not committed to
alldocs.go.

Change-Id: Iaa61e022d65f9464e8ff93a92cfba27dadf679cf
Reviewed-on: https://go-review.googlesource.com/127157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-04 16:37:47 +00:00
Ian Lance Taylor 65fa2b615b cmd/internal/objfile: only consider executable segments for load address
Reportedly on some new Fedora systems the linker is producing extra
load segments, basically making the dynamic section non-executable.
We were assuming that the first load segment could be used to
determine the program's load offset, but that is no longer true.
Use the first executable load segment instead.

Fixes #26369

Change-Id: I5ee31ddeef2e8caeed3112edc5149065a6448456
Reviewed-on: https://go-review.googlesource.com/127895
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 23:35:53 +00:00
Ian Lance Taylor 0bad63437e os: document that Remove removes only empty directories
Fixes #26507

Change-Id: I967e4f897ca891c70ca8bb0e66b984530c240815
Reviewed-on: https://go-review.googlesource.com/127835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-08-03 23:09:31 +00:00
Benjamin Cable 669ac1228a math/rand: improve package documentation
Notify readers that interval notation is used.
Fixes: #26765

Change-Id: Id02a7fcffbf41699e85631badeee083f5d4b2201
Reviewed-on: https://go-review.googlesource.com/127549
Reviewed-by: Rob Pike <r@golang.org>
2018-08-03 23:08:42 +00:00
Ian Lance Taylor 07bcfe5745 cmd/go: don't crash in go fmt on invalid input when using modules
Fixes #26792

Change-Id: I9a878180af28e3939b654fd88bed150010dffde0
Reviewed-on: https://go-review.googlesource.com/127856
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-03 19:51:38 +00:00
Austin Clements b800f202dc runtime: document assumption about wbBufFlush argument slots
gcWriteBarrier and wbBufFlush assume that not writing to an argument
variable is sufficient to not clobber the corresponding argument slot.
This assumption lets us simplify the write barrier assembly code,
speed up the flush path, and reduce the stack usage of the write
barrier.

But it is an assumption, so this CL documents it to make this clear.

Alternatively, we could separate the register spill slots from the
argument slots in the write barrier, but that loses the advantages
above. On the other hand, it's extremely unlikely that we'll change
the behavior of the compiler to start clobbering argument slots (if
anything, we'd probably change it to *not* clobber argument slots even
if you wrote to the arguments).

Fixes #25512.

Change-Id: Ib2cf29c0d90956ca02b997ef6e7fa56fc8044efe
Reviewed-on: https://go-review.googlesource.com/127815
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-08-03 18:35:45 +00:00
Brad Fitzpatrick 1b870077c8 net: skip flaky TestNotTemporaryRead on FreeBSD
Updates #25289

Change-Id: I662760b921be625aca988cd0b43c648ac5dfd814
Reviewed-on: https://go-review.googlesource.com/127837
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-03 17:21:10 +00:00
Ben Shi 9594ba4fe5 cmd/internal/obj/arm64: fix incorrect rejection of legal instructions
"BFI $0, R1, $7, R2" is expected to copy bit 0~6 from R1 to R2, and
left R2's other bits unchanged.

But the assembler rejects it with error "illegal bit number", and
BFIW/SBFIZ/SBFIZW/UBFIZ/UBFIZW have the same problem.

This CL fixes that issue and adds corresponding test cases.

fixes #26736

Change-Id: Ie0090a0faa38a49dd9b096a0f435987849800b76
Reviewed-on: https://go-review.googlesource.com/127159
Run-TryBot: Ben Shi <powerman1st@163.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-08-03 15:44:22 +00:00
Bryan C. Mills ac6d156479 cmd/go/internal/load: trim the " (test)" suffix from ImportStack paths
We were passing untrimmed paths to ModPackageModuleInfo, which was then failing
the build because it was asked to resolve an invalid path.

Fixes #26722

Change-Id: I043cc9c26f2188c5e005c0353620d9c55b339df9
Reviewed-on: https://go-review.googlesource.com/127795
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 15:37:24 +00:00
Mark Pulford 490035b0b9 cmd/go: disable ccache when setting HOME to non-existent dir
This fixes tests on systems where ccache is the default compiler.

Also simplify a prior workaround for this fault.

Fixed #26789

Change-Id: I031ff0b65ace7fc5e284393298e004aa2ad3b6f5
Reviewed-on: https://go-review.googlesource.com/127775
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-03 15:14:33 +00:00
Mikio Hara 15779d58ec net: update docs for unimplemented methods and functions
Change-Id: I54e651a952afa8928cc0204ba37092d3b2347266
Reviewed-on: https://go-review.googlesource.com/127737
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 15:08:42 +00:00
Frédéric Guillot 4cc09cd532 database/sql: fix driverStmt.Close() comment typo
Change-Id: I2256c850e071882b00c362da03abc8b021c1ec2a
Reviewed-on: https://go-review.googlesource.com/126015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 03:58:03 +00:00
Keith Randall 51ddeb9965 math: add tests for erf and erfc
Test large but not infinite arguments.

This CL adds a test which breaks s390x.  Don't submit until
a fix for that is figured out.

Update #26477

Change-Id: Ic86739fe3554e87d7f8e15482875c198fcf1d59c
Reviewed-on: https://go-review.googlesource.com/125641
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 03:38:52 +00:00
Ian Lance Taylor 0cab8bfddd cmd/go: revert "cmd/go: no longer eval symlinks in inDir"
It breaks on the Darwin builders, with

--- FAIL: TestTestCacheInputs (21.65s)
    go_test.go:5371: file.txt: old=2018-08-02 15:12:21.136438 -0700 PDT m=+219.458659208, info.ModTime=2018-08-02 15:12:21 -0700 PDT
    go_test.go:5377: running testgo [test testcache]
    go_test.go:5377: standard output:
    go_test.go:5377: ok  	testcache	0.013s

    go_test.go:5378: running testgo [test testcache]
    go_test.go:5378: standard output:
    go_test.go:5378: ok  	testcache	(cached)

    go_test.go:5382: running testgo [test testcache]
    go_test.go:5382: standard output:
    go_test.go:5382: ok  	testcache	0.172s

    go_test.go:5384: running testgo [test testcache]
    go_test.go:5384: standard output:
    go_test.go:5384: ok  	testcache	(cached)

    go_test.go:5387: running testgo [test testcache -run=FileSize]
    go_test.go:5387: standard output:
    go_test.go:5387: ok  	testcache	0.012s

    go_test.go:5388: running testgo [test testcache -run=FileSize]
    go_test.go:5388: standard output:
    go_test.go:5388: ok  	testcache	(cached)

    go_test.go:5391: running testgo [test testcache -run=FileSize]
    go_test.go:5391: standard output:
    go_test.go:5391: ok  	testcache	0.008s

    go_test.go:5393: running testgo [test testcache -run=FileSize]
    go_test.go:5393: standard output:
    go_test.go:5393: ok  	testcache	(cached)

    go_test.go:5396: running testgo [test testcache -run=Chdir]
    go_test.go:5396: standard output:
    go_test.go:5396: ok  	testcache	0.417s

    go_test.go:5397: running testgo [test testcache -run=Chdir]
    go_test.go:5397: standard output:
    go_test.go:5397: ok  	testcache	(cached)

    go_test.go:5400: running testgo [test testcache -run=Chdir]
    go_test.go:5400: standard output:
    go_test.go:5400: ok  	testcache	(cached)

    go_test.go:5401: did not notice file size change
    go_test.go:5401: pattern \(cached\) found unexpectedly in standard output
FAIL

Original CL description:

    Evaluating the symlinks was slowing down test cache checks.

    Fixes #26562
    Fixes #26726

            ijt:~/gopath/src/issue26562$ cat foo_test.go
            package foo_test

            import (
                    "fmt"
                    "os"
                    "path/filepath"
                    "testing"
            )

            // package and imports snipped
            func TestCache(t *testing.T) {
                    tmp := os.TempDir()
                    for i := 0; i < 1000000; i++ {
                            os.Stat(filepath.Join(tmp, fmt.Sprintf("%d", i)))
                    }
            }
            ijt:~/gopath/src/issue26562$ time ~/github/go/bin/go test -count=1
            PASS
            ok      issue26562      9.444s

            real    0m10.021s
            user    0m2.344s
            sys     0m7.835s
            ijt:~/gopath/src/issue26562$ time ~/github/go/bin/go test .
            ok      issue26562      (cached)

            real    0m0.802s
            user    0m0.551s
            sys     0m0.306s

Updates #26562
Updates #26726

Change-Id: I7914ee57dc75bcbd7f0ea01c70bed97d67c810ea
Reviewed-on: https://go-review.googlesource.com/127715
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 02:00:34 +00:00
bill_ofarrell f04a002e5a math: ensure Erfc is not called with out-of-expected-range arguments on s390x
The existing implementation produces correct results with a wide range of inputs,
but invalid results asymptotically. With this change we ensure correct asymptotic results
on s390x

Fixes #26477

Change-Id: I760c1f8177f7cab2d7622ab9a926dfb1f8113b49
Reviewed-on: https://go-review.googlesource.com/127119
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-03 01:21:31 +00:00
Phil Pearl db810b6e39 crypto/ecdsa: add a package level example
Change-Id: I4063d5ec4ac45561b94472b528583be564981912
Reviewed-on: https://go-review.googlesource.com/120144
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2018-08-02 22:14:25 +00:00
Issac Trotts 25aaeaa935 cmd/go: no longer eval symlinks in inDir
Evaluating the symlinks was slowing down test cache checks.

Fixes #26562
Fixes #26726

	ijt:~/gopath/src/issue26562$ cat foo_test.go
	package foo_test

	import (
		"fmt"
		"os"
		"path/filepath"
		"testing"
	)

	// package and imports snipped
	func TestCache(t *testing.T) {
		tmp := os.TempDir()
		for i := 0; i < 1000000; i++ {
			os.Stat(filepath.Join(tmp, fmt.Sprintf("%d", i)))
		}
	}
	ijt:~/gopath/src/issue26562$ time ~/github/go/bin/go test -count=1
	PASS
	ok      issue26562      9.444s

	real    0m10.021s
	user    0m2.344s
	sys     0m7.835s
	ijt:~/gopath/src/issue26562$ time ~/github/go/bin/go test .
	ok      issue26562      (cached)

	real    0m0.802s
	user    0m0.551s
	sys     0m0.306s

Change-Id: I3ce7f7b68bb5b9e802069f277e79e1ed3c162622
Reviewed-on: https://go-review.googlesource.com/127635
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-02 21:56:53 +00:00
Bryan C. Mills 6eabfab438 cmd/go: move mod_tidy.txt from testdata/mod to testdata/src
This file is clearly a script test, not a module definition, but it's in the
wrong directory to be run as one.

Fortunately, it passes with only minor modifications (changing “..” to “.”).

Change-Id: I66a544dfde82b8348108d2596c74e174157ae297
Reviewed-on: https://go-review.googlesource.com/127615
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-02 21:56:27 +00:00
Ian Lance Taylor 16ec18084e doc/go1.11: remove go/scanner note
The relevant change was reverted in CL 127658.

Updates #26671

Change-Id: I0c555c8e18f4c7e289de56d3ef840d79cf0adac2
Reviewed-on: https://go-review.googlesource.com/127659
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-02 21:36:10 +00:00
Ian Lance Taylor d6597ade89 go/scanner: continue adding directory to file name
Before CL 97795, when go/scanner saw a //line comment, it would clean
the path and, if the path was relative, prepend the directory from the
file name. This was not the best API because it meant that the
behavior changed based on whether the code was running on Windows or
not, and it meant that information from the //line directive was lost.
So in CL 97795, among other changes, go/scanner was changed to simply
return the filename given in the //line comment.

Unfortunately existing tools such as unparam and unconvert expected
the old behavior. In order to avoid breaking those tools, revert that
part of the change.

Fixes #26671

Change-Id: Ifa06542bd19cda9d682ac33766ab9080444ba050
Reviewed-on: https://go-review.googlesource.com/127658
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-02 21:34:24 +00:00
Richard Musiol 8589f46fe0 cmd/link/internal/wasm: add Go version as a custom wasm section
The interface between the wasm binary and wasm_exec.js is experimental
and likely to change in the future. Still, there are some early adopters
who experiment with non-web wasm runtimes. They can't use wasm_exec.js
and have to provide their own equivalent. Adding the Go version as a
custom wasm sections allows for them to support a stable Go version and
the latest devel at the same time.

Change-Id: I6d377bb0a0c33cb80e86dd15a34ddc9a70680227
Reviewed-on: https://go-review.googlesource.com/127597
Run-TryBot: Richard Musiol <neelance@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-02 20:56:11 +00:00
Brad Fitzpatrick 2069543bf1 encoding/xml: document HTMLAutoClose and HTMLEntity more
They didn't even have public types, which made them pretty mysterious.

Give them types and reference the Decoder, which uses them.

Also, refer them qualified by their package name in the examples, as
we usually do in example*.go files, which usually use package foo_test
specifically so we can show the package names along with the symbols.

Change-Id: I50ebbbf43778c1627bfa526f8824f52c7953454f
Reviewed-on: https://go-review.googlesource.com/127663
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-08-02 20:47:47 +00:00
Brad Fitzpatrick 2f46dfb271 encoding/xml: remove some primordial semicolons
Change-Id: I23e5d87648a4091fb4f6616bf80aa6c800974900
Reviewed-on: https://go-review.googlesource.com/127662
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-08-02 20:40:06 +00:00
Brad Fitzpatrick d9665d2381 syscall: use deprecation convention in package comment, simplify
Change-Id: I612041d31c01d49135947796fe2a09db3e6894d4
Reviewed-on: https://go-review.googlesource.com/127657
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-02 20:32:38 +00:00
Roberto Clapis faadda040d os: add check for empty executable path on darwin
os used to panic (access out of bounds) if executablePath was left empty

Fixes #22529

Change-Id: Iead5e60a3b000dbde421a8e8612c3690340879ce
Reviewed-on: https://go-review.googlesource.com/127546
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-02 20:31:25 +00:00
Brad Fitzpatrick b3b2f5d9ca cmd/go: skip cgo test when cgo isn't available
Fixes #26758

Change-Id: If08bafc85c353dfbb546107b75c8c884ab9c88e4
Reviewed-on: https://go-review.googlesource.com/127475
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-08-02 11:44:23 +00:00
Ben Shi de0e72610b test/codegen: add more combined store tests for arm64
Some combined store optimization was already implemented
in go-1.11, but there is no corresponding test cases.

Change-Id: Iebdad186e92047942e53a74f2c20b390922e1e9c
Reviewed-on: https://go-review.googlesource.com/122915
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-02 04:23:45 +00:00
Ian Lance Taylor a7df7b9cdb misc/cgo/testcshared: force descriptor 30 to be closed when execing test
Fixes #26730

Change-Id: I3396598282c814e75c0c4ef16f692dbe83d2935e
Reviewed-on: https://go-review.googlesource.com/127395
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-01 23:10:11 +00:00