- 18 Jul, 2018 27 commits
-
-
Hana (Hyang-Ah) Kim authored
The final API uses 'region' instead of 'span' from the proposal. Change-Id: I305da891a360596fff89b10bc6de3090289b5396 Reviewed-on: https://go-review.googlesource.com/124815Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
Change-Id: Ie4e81b88cc8035fddf9c074363a1b35bcae3d470 Reviewed-on: https://go-review.googlesource.com/124778Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Daniel Martí authored
If one tries to use promoted fields in a struct literal, the compiler errors correctly. However, if the embedded fields are of struct pointer type, the field.Type.Sym.Name expression below panics. This is because field.Type.Sym is nil in that case. We can simply use field.Sym.Name in this piece of code though, as it only concerns embedded fields, in which case what we are after is the field name. Added a test mirroring fixedbugs/issue23609.go, but with pointer types. Fixes #26416. Change-Id: Ia46ce62995c9e1653f315accb99d592aff2f285e Reviewed-on: https://go-review.googlesource.com/124395 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Ian Lance Taylor authored
Change-Id: I806d411c075cdc66322112b6ee5e50f58462bc6b Reviewed-on: https://go-review.googlesource.com/124776Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
Text based on CL 124655. Change-Id: I7c4866ce829cb28a4c60cd8ced3ef99047a38c54 Reviewed-on: https://go-review.googlesource.com/124711Reviewed-by: Austin Clements <austin@google.com>
-
Jack authored
If a filepath.WalkFunc is called with an non-nil err argument, it's possible that the info argument will be nil. The comment above filepath.WalkFunc now reflects this. Fixes #26425 Change-Id: Ib9963b3344587d2993f1698c5a801f2d1286856b GitHub-Last-Rev: 553fc266b570d0c47efe12b3b670f88112e3b334 GitHub-Pull-Request: golang/go#26435 Reviewed-on: https://go-review.googlesource.com/124635Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
Change-Id: I25b93a84996ab1c17d64089b4c2ffabdff3365ec Reviewed-on: https://go-review.googlesource.com/124710Reviewed-by: Austin Clements <austin@google.com>
-
Andrew Bonventre authored
Change-Id: Id06e5139f16cd7a85c59a3dcf2020cf647fcdea0 Reviewed-on: https://go-review.googlesource.com/124709Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Andrew Bonventre authored
Change-Id: I357eea0efb04392e1a4671d20190a2052bf548de Reviewed-on: https://go-review.googlesource.com/124706Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Andrew Bonventre authored
Update text/scanner and text/template sections. Change-Id: I1a273e99ff400870053cca63cea68fb7a9b56764 Reviewed-on: https://go-review.googlesource.com/124705Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Brad Fitzpatrick authored
This doesn't auto-deploy to golang.org, only tip.golang.org. Change-Id: I112743ada2c1393e21edcc9075127f40da9e6270 Reviewed-on: https://go-review.googlesource.com/124755Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
Change-Id: Id381ee73e678ff4b025c1c35512a755ba49d6f81 Reviewed-on: https://go-review.googlesource.com/124702 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Brad Fitzpatrick authored
Change-Id: Ic5b9ccb2772534cee77ffcaeee617c7d5edfb6fd Reviewed-on: https://go-review.googlesource.com/124715Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Hana (Hyang-Ah) Kim authored
Mention the change in the behavior of go test -memprofile. Change-Id: I0384f058298bd8fcfd2d97996464d46b4e419938 Reviewed-on: https://go-review.googlesource.com/124656Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Alberto Donizetti authored
Missed in CL 124516. Change-Id: I6488196c8392987d69eca832ab4969aaafe1a26c Reviewed-on: https://go-review.googlesource.com/124658Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Elias Naur authored
The change to make the runtime use libSystem.so macOS instead of direct kernel calls applies to iOS as well. Change-Id: I97ea86452ac5f7433aea58bbd3ff53a2eb2835e0 Reviewed-on: https://go-review.googlesource.com/124657Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ben Shi authored
The arm64 backend generates "TST" for "if uint32(a)&uint32(b) == 0", which should be "TSTW". fixes #26438 Change-Id: I7d64c30e3a840b43486bcd10eea2e3e75aaa4857 Reviewed-on: https://go-review.googlesource.com/124637 Run-TryBot: Ben Shi <powerman1st@163.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Alberto Donizetti authored
Change-Id: I6f8d9cc8997128d0076a3a3e82fe5155d53db40d Reviewed-on: https://go-review.googlesource.com/124659Reviewed-by: Rob Pike <r@golang.org>
-
Ian Lance Taylor authored
In CLs 122575 and 123177 the cgo tool started explicitly looking up typedefs. When there are two Go files using import "C", and the first one has an incomplete typedef and the second one has a complete version of the same typedef, then we will now record a version of the first typedef which will not match the recorded version of the second typedef, producing an "inconsistent definitions" error. Fix this by silently merging incomplete typedefs with complete ones. Fixes #26430 Change-Id: I9e629228783b866dd29b5c3a31acd48f6e410a2d Reviewed-on: https://go-review.googlesource.com/124575 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Rob Pike authored
This should have been added to the repo after Renee's Gophercon keynote. I will link to it from the FAQ. Change-Id: I0e5b88690e288827591d27b99420d3a449f7f662 Reviewed-on: https://go-review.googlesource.com/124615Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Russ Cox authored
It worked once. It needs to keep working. Change-Id: Iaa43726e1c78f0c4a20b5805c7c2bfa76fab2489 Reviewed-on: https://go-review.googlesource.com/124383 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 need an easy way to remove $GOPATH/src/mod, especially since all the directories are marked read-only. Change-Id: Ib9e8e47e50048f55ecc4de0229b06c4a416ac114 Reviewed-on: https://go-review.googlesource.com/124382 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Russ Cox authored
The top-level directory in a module was marked unwritable but not the subdirectories. Fix that. Change-Id: Ia57e5343624753851d9fe1ddfe496b870b67f924 Reviewed-on: https://go-review.googlesource.com/124381 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Russ Cox authored
Within the zip file for a given module, disallow names that are invalid on various operating systems (mostly Windows), and disallow having two different paths that are case-fold-equivalent. Disallowing different case-fold-equivalent paths means the zip file content is safe for case-insensitive file systems. There is more we could do to relax the rules later, but I think this should be enough to avoid digging a hole in the early days of modules that's hard to climb out of later. In tests on my repo test corpus, the repos now rejected are: github.com/vjeantet/goldap v0.0.0-20160521203625-ea702ca12a40 "doc/RFC 4511 - LDAP: The Protocol.txt": invalid char ':' github.com/ChimeraCoder/anaconda v0.0.0-20160509014622-91bfbf5de08d "json/statuses/show.json?id=404409873170841600": invalid char '?' github.com/bmatcuk/doublestar "test/a
☺ b": invalid char '☺ ' github.com/kubernetes-incubator/service-catalog v0.1.10 "cmd/svcat/testdata/responses/clusterserviceclasses?fieldSelector=spec.externalName=user-provided-service.json": invalid char '?' The : and ? are reserved on Windows, and the : is half-reserved (and quite confusing) on macOS. The☺ is perhaps an overreach, but I am not convinced that allowing all of category So is safe; certainly Sk is not. Change-Id: I83b6ac47ce6c442f726f1036bccccdb15553c0af Reviewed-on: https://go-review.googlesource.com/124380 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> -
Russ Cox authored
Over time there may exist two modules with names that differ only in case. On systems with case-insensitive file systems, we need to make sure those modules do not collide in the download cache. Do this by using the new "safe encoding" for file system paths as well as proxy paths. Fixes #25992. Change-Id: I717a9987a87ad5c6927d063bf30d10d9229498c9 Reviewed-on: https://go-review.googlesource.com/124379 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
Module paths, like import paths, are case-sensitive, for better or worse. But not all file systems distinguish file paths with different cases. If we are going to use module paths to construct file system paths, we must apply an encoding that distinguishes case without relying upon the file system to do it. This CL defines that encoding, the "safe module path encoding". Module paths today are ASCII-only with limited punctuation, so the safe module path encoding is to convert the whole path to lower case and insert an ! before every formerly upper-case letter: github.com/Sirupsen/logrus is stored as github.com/!sirupsen/logrus. Although this CL defines the encoding, it does not change the rest of the go command to use the encoding. That will be done in follow-up CLs. Change-Id: I06e6188dcfcbbc1d88674f7c95e1cb45cb476238 Reviewed-on: https://go-review.googlesource.com/124378 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
EduRam authored
Fixes #26385 Change-Id: I5594564f42898a71d30531e5132bddb3a6915247 GitHub-Last-Rev: fbd7b38b0419e21ecd22fe802ede5c0ee3f14a9a GitHub-Pull-Request: golang/go#26427 Reviewed-on: https://go-review.googlesource.com/124555Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 17 Jul, 2018 13 commits
-
-
Ian Lance Taylor authored
Fixes #25093 Change-Id: If283275e2b73621ade56d014e60c2d18199b366c Reviewed-on: https://go-review.googlesource.com/122555 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Rob Pike authored
Bring it up to date with recent terminology, mention new approaches such as in Rust, and link to the new blog post. Change-Id: I1d0b121e6f8347c3cf2c8ca0d8adc8285ce59ef1 Reviewed-on: https://go-review.googlesource.com/124475Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
Change-Id: I487bdf0c828d28b2122bd93934dc5a9a5dbc6a00 Reviewed-on: https://go-review.googlesource.com/124517Reviewed-by: Austin Clements <austin@google.com>
-
Austin Clements authored
Change-Id: I3c0cb9b56776d8cc78a96ef012385c31f9f0e146 Reviewed-on: https://go-review.googlesource.com/124516Reviewed-by: Austin Clements <austin@google.com>
-
Mostyn Bramley-Moore authored
Relates to #9679 Change-Id: I68951f664d2a03812dae309c580c181869d8af21 Reviewed-on: https://go-review.googlesource.com/122237 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Filippo Valsorda authored
CL 124135 follow-ups. Change-Id: Ib7e2066bd2d18851561e03386709a1b42b50fcef Reviewed-on: https://go-review.googlesource.com/124136Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
-
Frank Schroeder authored
Git timestamp parsing is broken when fetching modules if the local git configuration has 'log.showsignature=true'. Fixes #26388 Change-Id: I47f92381784072335a2a465de56092106c616108 GitHub-Last-Rev: 96f988c0a2dd39a5747ec4a7bad05e7e8ee0d384 GitHub-Pull-Request: golang/go#26389 Reviewed-on: https://go-review.googlesource.com/123958Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Steeve Morin authored
In Android's NDK16, jobject is now declared as: #ifdef __cplusplus class _jobject {}; typedef _jobject* jobject; #else /* not __cplusplus */ typedef void* jobject; #endif This makes the jobject to uintptr check fail because it expects the following definition: struct _jobject; typedef struct _jobject *jobject; Update the type check to handle that new type definition in both C and C++ modes. Fixes #26213 Change-Id: Ic36d4a5176526998d2d5e4e404f8943961141f7a GitHub-Last-Rev: 42037c3c584579c2b3281c25372b830e864e7aec GitHub-Pull-Request: golang/go#26221 Reviewed-on: https://go-review.googlesource.com/122217 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Alberto Donizetti authored
Since Go1.10, go test runs vet on the tests before executing them. Moreover, the vet tool typechecks the package under analysis with go/types before running. In Go1.10, a typechecking failure just caused a warning to be printed. In Go1.11, a typechecking failure will cause vet to exit with a fatal error (see Issue #21287). This means that starting with Go1.11, tests that don't typecheck will fail immediately. This would not normally be an issue, since a test that doesn't typecheck shouldn't even compile, and it should already be broken. Unfortunately, there's a bug in gc that makes it accept programs with unused variables inside a closure (Issue #3059). This means that a test with an unused variable inside a closure, that compiled and passed in Go1.10, will fail in the typechecking step of vet starting with Go1.11. Explain this in the 1.11 release notes. Fixes #26109 Change-Id: I970c1033ab6bc985d8c64bd24f56e854af155f96 Reviewed-on: https://go-review.googlesource.com/121455Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
This reverts commit c9930022. The original CL skipped the lldb test if it couldn't read compressed DWARF, but lldb can never read compressed DWARF, so this effectively disabled this test unconditionally. The previous commit disabled DWARF compression for this test, so the test now works on its own merits again. This CL reverts the change to skip the test so we don't simply mask lldb failures. Updates #25925. Change-Id: I3e1c787b658257b542c3c70807065dde9cfe05ee Reviewed-on: https://go-review.googlesource.com/124386 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Austin Clements authored
lldb doesn't support compressed DWARF, so right now we're just always skipping the lldb test. This CL makes the test run again by disabling compressed DWARF just for this test. Updates #25925. Change-Id: Ib9ddc442305fe6d37060d48f36bc4458b6fd8c86 Reviewed-on: https://go-review.googlesource.com/124385 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Michael Munday authored
Autos must be kept if their address reaches the control value of a block. We didn't see this before because it is rare for an auto's address to reach a control value without also reaching a phi or being written to memory. We can probably optimize away the comparisons that lead to this scenario since autos cannot alias with pointers from elsewhere, however for now we take the conservative approach and just ensure the auto is properly initialised if its address reaches a control value. Fixes #26407. Change-Id: I02265793f010a9e001c3e1a5397c290c6769d4de Reviewed-on: https://go-review.googlesource.com/124335Reviewed-by: David Chase <drchase@google.com>
-
Russ Cox authored
The original cmd/go tests were tiny shell scripts written against a library of shell functions. They were okay to write but difficult to run: you couldn't select individual tests (with -run) they didn't run on Windows, they were slow, and so on. CL 10464 introduced go_test.go's testgo framework and later CLs translated the test shell script over to individual go tests. This let us run tests selectively, run tests on Windows, run tests in parallel, isolate different tests, and so on. It was a big advance. The tests had always been awkward to write. Here was the first test in test.bash: TEST 'file:line in error messages' # Test that error messages have file:line information at beginning of # the line. Also test issue 4917: that the error is on stderr. d=$(TMPDIR=/var/tmp mktemp -d -t testgoXXX) fn=$d/err.go echo "package main" > $fn echo 'import "bar"' >> $fn ./testgo run $fn 2>$d/err.out || true if ! grep -q "^$fn:" $d/err.out; then echo "missing file:line in error message" cat $d/err.out ok=false fi rm -r $d The final Go version of this test was: func TestFileLineInErrorMessages(t *testing.T) { tg := testgo(t) defer tg.cleanup() tg.parallel() tg.tempFile("err.go", `package main; import "bar"`) path := tg.path("err.go") tg.runFail("run", path) shortPath := path if rel, err := filepath.Rel(tg.pwd(), path); err == nil && len(rel) < len(path) { shortPath = rel } tg.grepStderr("^"+regexp.QuoteMeta(shortPath)+":", "missing file:line in error message") } It's better but still quite difficult to skim. This CL introduces a new facility meant as a successor to the testgo approach that brings back the style of writing tests as little scripts, but they are now scripts in a built-for-purpose shell-like language, not bash itself. In this new form, the test above is a single file, testdata/script/fileline.txt: # look for short, relative file:line in error message ! go run ../../gopath/x/y/z/err.go stderr ^..[\\/]x[\\/]y[\\/]z[\\/]err.go: -- ../x/y/z/err.go -- package main; import "bar" The file is a txtar text archive (see CL 123359) in which the leading comment is the test script and the files are the initial state of the temporary file system where the script runs. Each script runs as a subtest, so that they can still be selected individually. The scripts are kept isolated from each other by default, so all script subtests are treated as parallel tests, for the testing package to run in parallel. Even for the 15 tests in this CL, that cuts the time for TestScript from 5.5s to 2.5s. The scripts do not have access to the cmd/go source directory, nor to cmd/go/testdata, so they are prevented from creating temporary files in those places or modifying existing ones. (Many existing tests scribble in testdata, unfortunately, especially testdata/pkg when they run builds with GOPATH=testdata.) This CL introduces the script facility and converts 15 tests. The txtar archive form will allow us to delete the large trees of trivial files in testdata; a few are deleted in this CL. See testdata/script/README for details and a larger conversion example. As part of converting testdata/script/test_badtest.txt, I discovered that 'go test' was incorrectly printing a FAIL line to stderr (not stdout) in one corner case. This CL fixes that to keep the test passing. Future CLs will convert more tests. Change-Id: I11aa9e18dd2d4c7dcd8e310dbdc6a1ea5f7e54c1 Reviewed-on: https://go-review.googlesource.com/123577 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-