- 02 Aug, 2018 9 commits
-
-
Ian Lance Taylor authored
The relevant change was reverted in CL 127658. Updates #26671 Change-Id: I0c555c8e18f4c7e289de56d3ef840d79cf0adac2 Reviewed-on: https://go-review.googlesource.com/127659Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
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>
-
Richard Musiol authored
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>
-
Brad Fitzpatrick authored
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/127663Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Brad Fitzpatrick authored
Change-Id: I23e5d87648a4091fb4f6616bf80aa6c800974900 Reviewed-on: https://go-review.googlesource.com/127662Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Brad Fitzpatrick authored
Change-Id: I612041d31c01d49135947796fe2a09db3e6894d4 Reviewed-on: https://go-review.googlesource.com/127657Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Roberto Clapis authored
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>
-
Brad Fitzpatrick authored
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>
-
Ben Shi authored
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>
-
- 01 Aug, 2018 18 commits
-
-
Ian Lance Taylor authored
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>
-
Xudong Zheng authored
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/127296Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
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/127356Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Brad Fitzpatrick authored
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>
-
Ian Lance Taylor authored
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>
-
as authored
Fixes #26738 Change-Id: Icede3f59acb5b0e388660653cefc24a195b5d43b GitHub-Last-Rev: 9989b74c12e94163c1f18859485a4ac0d74c5453 GitHub-Pull-Request: golang/go#26739 Reviewed-on: https://go-review.googlesource.com/127160Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
David Wimmer authored
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>
-
Keith Randall authored
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>
-
Daniela Petruzalek authored
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/127135Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
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>
-
Russ Cox authored
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>
-
Russ Cox authored
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>
-
Russ Cox authored
Relative directory paths have always worked. This CL makes absolute directory paths be handled the same way. (It was an oversight that they were excluded.) It also fixes the case of naming the directory holding source code for a package in a module dependency. Fixes #14177. Fixes #26550. Change-Id: I29a0ca2795d35eca773121ee91a97628b56947ce Reviewed-on: https://go-review.googlesource.com/126715 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Russ Cox authored
The old -getmode flag had two settings: -getmode=local meant don't download from the network. -getmode=vendor meant only use the vendor directory. The new -mod flag has two settings: -mod=readonly means refuse to automatically update go.mod (mainly for CI testing). -mod=vendor means only use the vendor directory. The old GOPROXY variable had two settings: a proxy URL or else the empty string (direct connect). The new GOPROXY variable has three settings: a proxy URL, the string "off" (no network use allowed), or else the empty string or the explicit string "direct" (direct connection). We anticipate allow a comma-separated sequence in a future release, so commas are disallowed entirely right now. Fixes #24666. Fixes #26586. Fixes #26370. Fixes #26361. Change-Id: If2601a16b09f04800f666938c071fc053b4c3f9c Reviewed-on: https://go-review.googlesource.com/126696 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Russ Cox authored
People sometimes want to turn on a particular go command flag by default. In Go 1.11 we have at least two different cases where users may need this. 1. Linking can be noticeably slower on underpowered systems due to DWARF, and users may want to set -ldflags=-w by default. 2. For modules, some users or CI systems will want vendoring always, so they want -getmode=vendor (soon to be -mod=vendor) by default. This CL generalizes the problem to “set default flags for the go command.” $GOFLAGS can be a space-separated list of flag settings, but each space-separated entry in the list must be a standalone flag. That is, you must do 'GOFLAGS=-ldflags=-w' not 'GOFLAGS=-ldflags -w'. The latter would mean to pass -w to go commands that understand it (if any do; if not, it's an error to mention it). For #26074. For #26318. Fixes #26585. Change-Id: I428f79c1fbfb9e41e54d199c68746405aed2319c Reviewed-on: https://go-review.googlesource.com/126656 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
CL 108156 added -cgo during the Go 1.11 cycle. To avoid adding a new field to Package, it redefined the meaning of the CgoFiles list to be the cgo output instead of the cgo input. This was awkward in the go command itself, since the meaning of the list changed midway through the build. But, worse, it is awkward to users of go list. When gathering information about a tree of packages, we may want the names of both the cgo inputs and the cgo outputs (golang.org/x/tools/go/packages does, it turns out), or when combined with -deps (CL 107776), we may only care about one list or the other depending on whether the package was requested explicitly or is being returned as a dependency. Also, it's not general enough. SWIGFiles turn into cgo files and then end up in the list too. And maybe there will be others in the future. What clients really want is the list of files that are presented to the go compiler, so that they can parse and type-check them as if they were the compiler instead. Eliminate all this awkwardness by dropping -cgo and adding a new -compiled that populates a new CompiledGoFiles list. Change-Id: I5f152da17cfb2692eedde61721d01ec13067c57d Reviewed-on: https://go-review.googlesource.com/126695 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Russ Cox authored
The current "go mod" command does too many things. The design is unclear. It looks like "everything you might want to do with modules" which causes people to think all module operations go through "go mod", which is the opposite of the seamless integration we're going for. In particular too many people think "go mod -require" and "go get" are the same. It does make sense to put the module-specific functionality under "go mod", but not as flags. Instead, split "go mod" into multiple subcommands: go mod edit # old go mod -require ... go mod fix # old go mod -fix go mod graph # old go mod -graph go mod init # old go mod -init go mod tidy # old go mod -sync go mod vendor # old go mod -vendor go mod verify # old go mod -verify Splitting out the individual commands makes both the docs and the implementations dramatically easier to read. It simplifies the command lines (go mod -init -module m is now 'go mod init m') and allows command-specific flags. We've avoided subcommands in the go command to date, and we should continue to avoid adding them unless it really makes the experience significantly better. In this case, it does. Creating subcommands required some changes in the core command-parsing and help logic to generalize from one level to multiple levels. As part of having "go mod init" be a separate command, this CL changes the failure behavior during module initialization to be delayed until modules are actually needed. Initialization can still happen early, but the base.Fatalf is delayed until something needs to use modules. This fixes a bunch of commands like 'go env' that were unhelpfully failing with GO111MODULE=on when not in a module directory. Fixes #26432. Fixes #26581. Fixes #26596. Fixes #26639. Change-Id: I868db0babe8c288e8af684b29d4a5ae4825d6407 Reviewed-on: https://go-review.googlesource.com/126655 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Russ Cox authored
We aren't planning to use this or advertise it much yet, but having support for it now will make it easier to start using in the future - older go commands will understand what 'go 1.20' means and that they don't have go 1.20. Fixes #23969. Change-Id: I729130b2690d3c0b794b49201526b53de5093c45 Reviewed-on: https://go-review.googlesource.com/125940 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
- 31 Jul, 2018 13 commits
-
-
Brad Fitzpatrick authored
Saves ~105KB of heap for callers who don't use html.UnescapeString. (EscapeString is much more common). Also saves 70KB of binary size, because now the linker can do dead code elimination. (because #2559 is still open and global maps always generate init code) Fixes #26727 Updates #6853 Change-Id: I18fe9a273097e2c7e0cb7f88205cae1bb60fa89b Reviewed-on: https://go-review.googlesource.com/127075 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Mohit kumar Bajoria authored
Fixes #26611 Change-Id: I111152c7b1156a461c9ddeaf16d2fe7a2d5a00c1 GitHub-Last-Rev: 72090d539b5601b8c585628a11a99b03103d5a75 GitHub-Pull-Request: golang/go#26724 Reviewed-on: https://go-review.googlesource.com/126935Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Kir Kolyshkin authored
Due to a new specification of //line: directives, missing column info is now treated as column 0, aka "unknown column" (see https://github.com/golang/go/issues/24183 for details). As cgo does not add column number to generated //line: directive, resulting files parsed do not have column info. Fix by adding column of 1 to generated line directives. Fixes #26692 Change-Id: Ie9263c0cf666b92d19c34240e745e8f32ffe7174 Reviewed-on: https://go-review.googlesource.com/126675 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Keith Randall authored
Ensure that we call FinishType on all the types added to the ptrs map. We only add a key to ptrKeys once. Once we FinishType for that key, we'll never look at that key again. But we can add a new type under that key later, and we'll never finish it. Make sure we add the key to the ptrKeys list every time we make the list of types for that key non-empty. This makes sure we FinishType each pointer type exactly once. Fixes #26517 Change-Id: Iad86150d516fcfac167591daf5a26c38bec7d143 Reviewed-on: https://go-review.googlesource.com/126275Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Bryan C. Mills authored
Some of the arguments — particularly format strings passed to git commands — may contain spaces, and it's useful to be able to paste commands from 'go get -x foo' directly into a shell to reproduce their output. Change-Id: I4f0c0b4e05db8b5232458e9a271f2ccbb665e85a Reviewed-on: https://go-review.googlesource.com/126955 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Change-Id: Idbc507ae3df791a759b967bcbe833b8e08bd9611 Reviewed-on: https://go-review.googlesource.com/125817Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Brad Fitzpatrick authored
Also updates the bundled http2 to x/net/http2 git rev 49c15d80 for: http2: revert CL 107295 (don't sniff Content-type in Server when nosniff) https://golang.org/cl/126895 Fixes #24795 Change-Id: I6ae1a21c919947089274e816eb628d20490f83ce Reviewed-on: https://go-review.googlesource.com/126896Reviewed-by: Damien Neil <dneil@google.com>
-
Richard Musiol authored
This commit removes O_NONBLOCK on js/wasm. O_SYNC can't be removed, because it is referenced by the os package, so instead its use returns an error. On Windows, the options O_NONBLOCK and O_SYNC are not available when opening a file with Node.js. This caused the initialization of the syscall package to panic. The simplest solution is to not support these two options on js/wasm at all. Code written for js/wasm is supposed to be portable, so platform-specific options should not be used. Fixes #26524. Change-Id: I366aa3cdcfa59dfa9dc513368259f363ca090f00 Reviewed-on: https://go-review.googlesource.com/126600Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Agniva De Sarker authored
Updates #25443 Change-Id: I5e2f84f3cee6582807b2756ffac91e8583a2baec Reviewed-on: https://go-review.googlesource.com/126737Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Richard Musiol authored
This commit moves the documentation about how Go values are mapped to JavaScript values to the functions that apply the mapping, instead of mentioning them in the documentation of the types being mapped. This should be easier to read. Change-Id: I2465eb4a45f71b3b61624349e908a195010a09f1 Reviewed-on: https://go-review.googlesource.com/126856Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Roger Peppe authored
The example code was treating a method starting with Test as a test function when considering whether to produce a whole-file example or not. As a method can never be a test function, this isn't correct. Change-Id: Idd8ec9eaf0904af076e941d7fe7d967f6b7eef78 Reviewed-on: https://go-review.googlesource.com/125257Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Change-Id: I4d01be5330db06877065aabe7a3faf69bce0dfb2 Reviewed-on: https://go-review.googlesource.com/126515Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Yury Smolsky authored
This struct, global var and method are not used anywhere. Change-Id: I83d9e93041a46904064d0fa88ab655a50149c747 Reviewed-on: https://go-review.googlesource.com/126397 Run-TryBot: Yury Smolsky <yury@smolsky.by> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-