summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* A+C: update Dmitri Shuralyov's emailsDmitri Shuralyov2018-08-082-2/+2
| | | | | | | | | 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>
* net: reduce TestSplice/big's memory usageDaniel Martí2018-08-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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>
* cmd/go: 3 cmd/go tests (>8s) made as non-short scriptsGn Shivakumar2018-08-074-51/+67
| | | | | | | | | | | | | | | | | | * 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>
* cmd/go: make 'go get <module>@none' idempotentBryan C. Mills2018-08-072-2/+16
| | | | | | | | | | 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>
* cmd/go/internal/load: remove unused argument from LookupBryan C. Mills2018-08-072-17/+15
| | | | | | Change-Id: Ia2948a88c6d45a31be17b3d7415559cd53c289ce Reviewed-on: https://go-review.googlesource.com/128015 Reviewed-by: Russ Cox <rsc@golang.org>
* cmd/go/internal/load: pass the importer's package path when checking visibilityBryan C. Mills2018-08-073-28/+116
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cmd/go: fix outdated commentsBryan C. Mills2018-08-072-4/+1
| | | | | | Change-Id: I09532546c96b3758f76528fb5010dafc638139b8 Reviewed-on: https://go-review.googlesource.com/128135 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall/js: extend ValueOf to support arrays and objectsRichard Musiol2018-08-072-9/+41
| | | | | | | | | | | 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>
* cmd/asm/internal/arch: add package definitionMario Arranz2018-08-061-0/+1
| | | | | | | | | | | | 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: a859e9410f38073853687b933f53eb6570af3216 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>
* doc: describe cgo ptr->uintptr changes for 1.11.Keith Randall2018-08-061-0/+13
| | | | | | | | Fixes #26721 Change-Id: Icc4660327a9ba668c88f8d9e0b9f206ba8f6dc27 Reviewed-on: https://go-review.googlesource.com/127975 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/go: fix go get fail when GIT_TRACE setLE Manh Cuong2018-08-062-9/+14
| | | | | | | | | | | | | | | | 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>
* cmd/go: fix unnecessary pluralKevin Burke2018-08-042-9/+13
| | | | | | | | | | "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>
* cmd/internal/objfile: only consider executable segments for load addressIan Lance Taylor2018-08-031-1/+1
| | | | | | | | | | | | | | | | 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>
* os: document that Remove removes only empty directoriesIan Lance Taylor2018-08-031-1/+1
| | | | | | | | | 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>
* math/rand: improve package documentationBenjamin Cable2018-08-032-3/+6
| | | | | | | | | 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>
* cmd/go: don't crash in go fmt on invalid input when using modulesIan Lance Taylor2018-08-032-1/+14
| | | | | | | | | | | 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>
* runtime: document assumption about wbBufFlush argument slotsAustin Clements2018-08-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | 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>
* net: skip flaky TestNotTemporaryRead on FreeBSDgo1.11beta3Brad Fitzpatrick2018-08-031-0/+4
| | | | | | | | | | 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>
* cmd/internal/obj/arm64: fix incorrect rejection of legal instructionsBen Shi2018-08-032-6/+32
| | | | | | | | | | | | | | | | | "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>
* cmd/go/internal/load: trim the " (test)" suffix from ImportStack pathsBryan C. Mills2018-08-032-3/+22
| | | | | | | | | | | 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>
* cmd/go: disable ccache when setting HOME to non-existent dirMark Pulford2018-08-032-6/+5
| | | | | | | | | | | | | | 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>
* net: update docs for unimplemented methods and functionsMikio Hara2018-08-037-8/+14
| | | | | | | | 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>
* database/sql: fix driverStmt.Close() comment typoFrédéric Guillot2018-08-031-1/+1
| | | | | | Change-Id: I2256c850e071882b00c362da03abc8b021c1ec2a Reviewed-on: https://go-review.googlesource.com/126015 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* math: add tests for erf and erfcKeith Randall2018-08-031-0/+8
| | | | | | | | | | | | | | | 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>
* cmd/go: revert "cmd/go: no longer eval symlinks in inDir"Ian Lance Taylor2018-08-031-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* math: ensure Erfc is not called with out-of-expected-range arguments on s390xbill_ofarrell2018-08-031-12/+13
| | | | | | | | | | | | | | 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>
* crypto/ecdsa: add a package level examplePhil Pearl2018-08-021-0/+32
| | | | | | | | 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>
* cmd/go: no longer eval symlinks in inDirIssac Trotts2018-08-021-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cmd/go: move mod_tidy.txt from testdata/mod to testdata/srcBryan C. Mills2018-08-021-5/+5
| | | | | | | | | | | | | 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>
* doc/go1.11: remove go/scanner noteIan Lance Taylor2018-08-021-11/+1
| | | | | | | | | | 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>
* go/scanner: continue adding directory to file nameIan Lance Taylor2018-08-022-4/+38
| | | | | | | | | | | | | | | | | | | | | | 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>
* cmd/link/internal/wasm: add Go version as a custom wasm sectionRichard Musiol2018-08-021-0/+9
| | | | | | | | | | | | | | 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>
* encoding/xml: document HTMLAutoClose and HTMLEntity moreBrad Fitzpatrick2018-08-021-4/+8
| | | | | | | | | | | | | | 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>
* encoding/xml: remove some primordial semicolonsBrad Fitzpatrick2018-08-021-2/+2
| | | | | | Change-Id: I23e5d87648a4091fb4f6616bf80aa6c800974900 Reviewed-on: https://go-review.googlesource.com/127662 Reviewed-by: Bryan C. Mills <bcmills@google.com>
* syscall: use deprecation convention in package comment, simplifyBrad Fitzpatrick2018-08-021-8/+5
| | | | | | Change-Id: I612041d31c01d49135947796fe2a09db3e6894d4 Reviewed-on: https://go-review.googlesource.com/127657 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* os: add check for empty executable path on darwinRoberto Clapis2018-08-021-0/+5
| | | | | | | | | | | | 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>
* cmd/go: skip cgo test when cgo isn't availableBrad Fitzpatrick2018-08-021-0/+2
| | | | | | | | | | 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>
* test/codegen: add more combined store tests for arm64Ben Shi2018-08-021-0/+54
| | | | | | | | | | | 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>
* misc/cgo/testcshared: force descriptor 30 to be closed when execing testIan Lance Taylor2018-08-011-0/+10
| | | | | | | | | | 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>
* syscall/js: move callback helper code to misc/wasm to avoid using eval()Xudong Zheng2018-08-012-27/+27
| | | | | | | | | | | | When using the compiled .wasm with misc/wasm/wasm_exec.js, we get an error message if the site prohibits eval() via the Content-Security-Policy header. This can be resolved by moving the callback helper code from src/syscall/js/callback.go to misc/wasm/wasm_exec.js. Fixes #26748 Change-Id: I28f271b8a00631f4c66a1ac31305e85f20f9d420 GitHub-Last-Rev: a6a0268f38d36c198ca6b4ceb2e75cc8afec74eb GitHub-Pull-Request: golang/go#26750 Reviewed-on: https://go-review.googlesource.com/127296 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/cgo: don't give inconsistent typedef error for cgo-defined typesIan Lance Taylor2018-08-014-0/+34
| | | | | | | | | | | | The cgo tool predefines some C types such as C.uint. Don't give an error if the type that cgo defines does not match the type in a header file. Fixes #26743 Change-Id: I9ed3b4c482b558d8ffa8bf61eb3209415b7a9e3c Reviewed-on: https://go-review.googlesource.com/127356 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
* vendor: update golang.org/x/net/http2/hpackBrad Fitzpatrick2018-08-015-67/+123
| | | | | | | | | | | | | | | | | | | | | | | Updates bundled golang.org/x/net/http2/hpack to x/net git rev 22bb95c5e for: http2/hpack: lazily build huffman table on first use https://golang.org/cl/127275 http2/hpack: reduce memory for huffman decoding table https://golang.org/cl/127235 http2/hpack: dynamic table updates must occur first https://golang.org/cl/111681 And a typo & gofmt CL. Updates #25023 Change-Id: I7027fdb4982305aa671d811fe87f61e5df0f8e0e Reviewed-on: https://go-review.googlesource.com/127355 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/build: accept ! in cgo argumentsIan Lance Taylor2018-08-013-1/+28
| | | | | | | | | | | | The ! can show up when using ${SRCDIR} with uppercase letters in module names. Fixes #26716 Change-Id: Ia474ed8ec40a88076e8aac21103f6c7bb3848bdb Reviewed-on: https://go-review.googlesource.com/127297 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/go: avoid panic on 'go mod' without argumentsas2018-08-011-0/+2
| | | | | | | | | | | Fixes #26738 Change-Id: Icede3f59acb5b0e388660653cefc24a195b5d43b GitHub-Last-Rev: 9989b74c12e94163c1f18859485a4ac0d74c5453 GitHub-Pull-Request: golang/go#26739 Reviewed-on: https://go-review.googlesource.com/127160 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
* runtime: fix syscall error returns on mips/mips64/ppc64David Wimmer2018-08-013-3/+43
| | | | | | | | | | | | | | | | | | | | | | The linux syscall functions used in runtime are designed around the calling convention of returning errors as negative numbers. On some other systems (like mips and ppc) the actual syscalls signal errors in other ways. This means that the assembly implementations of the syscall functions on these platforms need to transform the return values in the error cases to match the expected negative errno values. This was addressed for certain syscalls in https://golang.org/cl/19455 and https://golang.org/cl/89235. This patch handles the rest of the syscall functions in sys_linux_*.s that return any value for mips/mips64/ppc64. Fixes #23446 Change-Id: I302100261231f76d5850ab2c2ea080170d7dba72 GitHub-Last-Rev: e358e2b08c76897b13f917cfa12b5085e20337f9 GitHub-Pull-Request: golang/go#26606 Reviewed-on: https://go-review.googlesource.com/125895 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* cmd/cgo: stop expanding typedefs once we reach __builtin typesKeith Randall2018-08-011-0/+4
| | | | | | | | | | | | | | | Expanding __builtin types (__builtin_va_list, particularly) leads to problems because they are expanded by the compiler itself - the expansions are not generated by anything in a .h file. The types a __builtin type expand to are thus very confusing to cgo. See CL 126275. Change-Id: I66eb6a4f27f652f1b934ba702f580f6daa62a566 Reviewed-on: https://go-review.googlesource.com/127156 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* strconv: clarify "g" and "G" precision in the docsDaniela Petruzalek2018-08-012-7/+9
| | | | | | | | | | | Fix the wording in "strconv" and "fmt" to make explicit that the "g" and "G" formats remove trailing zeroes. Fixes #25082 Change-Id: I2e2ad0a98d2ea27a3a8a006a0563b366f7a3b71b Reviewed-on: https://go-review.googlesource.com/127135 Reviewed-by: Rob Pike <r@golang.org>
* cmd/doc: adapt directory search for modulesRuss Cox2018-08-015-31/+180
| | | | | | | | | | | | | | | | | | | | | | Previously, cmd/doc treated GOROOT/src and GOPATH/src as the roots of the directory trees holding packages, assuming that the import path would be the path elements after the src directory. With modules, each module serves as its own root of a file tree, and the import path prefix starts with the module path before adding the path elements after the module root. There are ways we could make this more efficient, but for now this is a fairly small adjustment to get 'go doc' working OK for modules for Go 1.11. Fixes #26635. Change-Id: Ifdee4194601312846c7b1fc67f2fe7a4a44269cc Reviewed-on: https://go-review.googlesource.com/126799 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
* cmd/go: move module cache from $GOPATH/src/mod to $GOPATH/pkg/modRuss Cox2018-08-0118-101/+120
| | | | | | | | | | | | | | | | | | Using $GOPATH/src/mod confuses too many tools. $GOPATH/pkg/mod seems better for now. It's also next to dep's cache, $GOPATH/pkg/dep. If we do eliminate GOPATH/pkg for holding .a files (#4719) then we could still keep it around for pkg/mod. (Or we could move the module cache again then.) Fixes #26401. Fixes #26635. Change-Id: I18f7da216ed9f490eded3c00d837fb086ae5b6a4 Reviewed-on: https://go-review.googlesource.com/126755 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Rob Pike <r@golang.org>
* cmd/go: add list -find to find packages but not resolve importsRuss Cox2018-08-013-0/+27
| | | | | | | | | | | | | | This is needed by golang.org/x/tools/go/packages and also gives a way to do a quicker scan for packages with a given final path element: go list -find .../template Change-Id: I092f4ac5ba7af7d727eb8204379fa436667061b9 Reviewed-on: https://go-review.googlesource.com/126716 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>