1
0
mirror of https://github.com/golang/go synced 2024-11-07 16:36:24 -07:00
Commit Graph

37427 Commits

Author SHA1 Message Date
David Chase
2fe2aa0983 cmd/compile: avoid compressed dwarf when testing for gdb on OSX
Until we figure out how to deal with gdb on Darwin (doesn't
read compressed DWARF from binaries), avoid compressing
DWARF in that case so that the test will still yield meaningful
results.

This is also reported to be a problem for Windows.

Problem also exists for lldb, but this test doesn't check
lldb.

Updates #25925

Change-Id: I85c0e5db75f3329957290500626a3ac7f078f608
Reviewed-on: https://go-review.googlesource.com/124712
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2018-07-19 13:58:32 +00:00
Russ Cox
d278f09333 cmd/go: skip TestScript/mod_* on Windows
I don't know why it's failing.
Filed #26457.

Change-Id: I84833293a572c5a1a25135bd01cb88518fc7441e
Reviewed-on: https://go-review.googlesource.com/124857
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-07-19 05:40:37 +00:00
Russ Cox
eec9a89560 cmd/go/internal/str: simplify HasPathPrefix by epsilon
Pointed out in CL 122396.
An empty prefix has already been handled above.

Change-Id: Ib94df0a9c8c0517f932b90126232111caa9ad289
Reviewed-on: https://go-review.googlesource.com/124797
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-07-19 05:28:16 +00:00
Russ Cox
6140829edf cmd/go: convert still more module tests to scripts
Change-Id: I249bb848c9911948dbd84cd88ad043a61ed6ea6b
Reviewed-on: https://go-review.googlesource.com/124699
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-07-19 05:28:09 +00:00
Russ Cox
e3f15e3b1d cmd/go: convert even more module tests to scripts
Change-Id: Iba185e00e9df2462e9089566053f6c64e24a6a92
Reviewed-on: https://go-review.googlesource.com/124698
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-07-19 05:28:03 +00:00
Russ Cox
4d5bf3cca5 cmd/go: convert more module tests to scripts
Change-Id: I8a36fad061bdf9a19f40531511f3f5717db13b60
Reviewed-on: https://go-review.googlesource.com/124697
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-07-19 05:27:55 +00:00
Russ Cox
d286d4b141 cmd/go: convert module tests to scripts
Change-Id: If0976d15027db795f1383ef709c49c838cbb6953
Reviewed-on: https://go-review.googlesource.com/124696
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-07-19 05:27:53 +00:00
Brad Fitzpatrick
c54bc34483 net/http: deflake TestClientTimeoutKillsConn_AfterHeaders
It was flaky on slower machines.

Per report at https://github.com/golang/go/issues/23399#issuecomment-405792381

Change-Id: I7cab02821f78b5ce02ea51089d7eb51723f9705f
Reviewed-on: https://go-review.googlesource.com/124835
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-19 00:23:07 +00:00
Rob Pike
3bb4be79ba doc: update the Origins section of the FAQ
Completely replace the opener, which had become not only stale
but bad, expand the discussion of the gopher, and generally provide
prose more connected to the present than to the programming world
of 2007.

Fixes #26107

Change-Id: I5e72f0c81e71d1237fe142dc26114991329a6996
Reviewed-on: https://go-review.googlesource.com/124616
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-19 00:12:12 +00:00
Ian Lance Taylor
1ff8717aeb doc: fill in final standard library TODOs in go1.11.html
Change-Id: Ic1ff580573711a6c91c1d5e3eb019a298a2fec49
Reviewed-on: https://go-review.googlesource.com/124837
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 22:30:17 +00:00
Brad Fitzpatrick
9c9c5a032f doc: update go1.11 release notes
Change-Id: I9008afdc8c38c440ea083a4f2bed0d2253e112f0
Reviewed-on: https://go-review.googlesource.com/124836
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-18 21:59:48 +00:00
Andrew Bonventre
1de44474c0 doc: update go1.11 release notes
Change-Id: I3e2a19fe90334f0c1ed1593c7a9a3a458f15d8e8
Reviewed-on: https://go-review.googlesource.com/124799
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-07-18 20:51:53 +00:00
Andrew Bonventre
e954bdb021 doc: update go1.11 release notes
Change-Id: Ib488a78802ad730e7c6b3618eab24c259f4bebd1
Reviewed-on: https://go-review.googlesource.com/124798
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-07-18 20:46:34 +00:00
Brad Fitzpatrick
8cbc02af8b doc/go1.11: add some links to text/scanner, remove parens
Change-Id: I30d2b4b94f26300f2cf7b4ecd328a4875d69db51
Reviewed-on: https://go-review.googlesource.com/124777
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-18 20:43:56 +00:00
Hana (Hyang-Ah) Kim
407eb30f9f doc/go1.11: update runtime/trace to use region instead of span
The final API uses 'region' instead of 'span' from the proposal.

Change-Id: I305da891a360596fff89b10bc6de3090289b5396
Reviewed-on: https://go-review.googlesource.com/124815
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-18 20:33:00 +00:00
Ian Lance Taylor
7ae4909458 doc: add a couple of links to go1.11 release notes
Change-Id: Ie4e81b88cc8035fddf9c074363a1b35bcae3d470
Reviewed-on: https://go-review.googlesource.com/124778
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-18 20:32:18 +00:00
Daniel Martí
ba6974fdc3 cmd/compile: fix crash on invalid struct literal
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>
2018-07-18 20:32:04 +00:00
Ian Lance Taylor
ee198df4cd doc: update go1.11 release notes
Change-Id: I806d411c075cdc66322112b6ee5e50f58462bc6b
Reviewed-on: https://go-review.googlesource.com/124776
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 20:21:01 +00:00
Austin Clements
798f74b9e6 doc/go1.11: shorten, tidy, and promote user annotation API
Text based on CL 124655.

Change-Id: I7c4866ce829cb28a4c60cd8ced3ef99047a38c54
Reviewed-on: https://go-review.googlesource.com/124711
Reviewed-by: Austin Clements <austin@google.com>
2018-07-18 20:11:46 +00:00
Jack
4016de0daf filepath: updates doc to give case where WalkFunc info arg may be nil
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: 553fc266b5
GitHub-Pull-Request: golang/go#26435
Reviewed-on: https://go-review.googlesource.com/124635
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 19:53:37 +00:00
Austin Clements
d2f663c4f2 doc/go1.11: mention major performance optimizations
Change-Id: I25b93a84996ab1c17d64089b4c2ffabdff3365ec
Reviewed-on: https://go-review.googlesource.com/124710
Reviewed-by: Austin Clements <austin@google.com>
2018-07-18 19:49:09 +00:00
Andrew Bonventre
d0764a2481 doc: update go1.11.html removing TODO about TLS offsets
Change-Id: Id06e5139f16cd7a85c59a3dcf2020cf647fcdea0
Reviewed-on: https://go-review.googlesource.com/124709
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-07-18 19:44:31 +00:00
Andrew Bonventre
c7c147c830 doc: update go1.11.html with user annotation API additions
Change-Id: I357eea0efb04392e1a4671d20190a2052bf548de
Reviewed-on: https://go-review.googlesource.com/124706
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-07-18 19:19:20 +00:00
Andrew Bonventre
96b5f6dd1d doc: update go1.11 release notes
Update text/scanner and text/template sections.

Change-Id: I1a273e99ff400870053cca63cea68fb7a9b56764
Reviewed-on: https://go-review.googlesource.com/124705
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-07-18 19:07:10 +00:00
Brad Fitzpatrick
ac1cb992ea doc/go1.11: remove unnecessary absolute link
This doesn't auto-deploy to golang.org, only tip.golang.org.

Change-Id: I112743ada2c1393e21edcc9075127f40da9e6270
Reviewed-on: https://go-review.googlesource.com/124755
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-07-18 18:28:37 +00:00
Russ Cox
b9761b18e1 doc/go1.11: link to module overview
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>
2018-07-18 17:33:28 +00:00
Brad Fitzpatrick
3522cd8a20 doc: fix a link in go1.11.html and flesh out a few sections
Change-Id: Ic5b9ccb2772534cee77ffcaeee617c7d5edfb6fd
Reviewed-on: https://go-review.googlesource.com/124715
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 16:32:58 +00:00
Hana (Hyang-Ah) Kim
311ec41b5a doc/go1.11: update runtime/pprof change note
Mention the change in the behavior of go test -memprofile.

Change-Id: I0384f058298bd8fcfd2d97996464d46b4e419938
Reviewed-on: https://go-review.googlesource.com/124656
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 15:15:35 +00:00
Alberto Donizetti
bd9a0185d2 doc/go1.11: add space in Go version name
Missed in CL 124516.

Change-Id: I6488196c8392987d69eca832ab4969aaafe1a26c
Reviewed-on: https://go-review.googlesource.com/124658
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 14:56:41 +00:00
Elias Naur
8362a8e127 doc/go1.11: mention the libSystem.so change for iOS
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/124657
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 14:46:59 +00:00
Ben Shi
f6ce1e2aa5 cmd/compile: fix an arm64's comparison bug
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>
2018-07-18 14:15:05 +00:00
Alberto Donizetti
07b81912d4 doc/go1.11: add time package changes to release notes
Change-Id: I6f8d9cc8997128d0076a3a3e82fe5155d53db40d
Reviewed-on: https://go-review.googlesource.com/124659
Reviewed-by: Rob Pike <r@golang.org>
2018-07-18 10:05:16 +00:00
Ian Lance Taylor
a371bc2dfd cmd/cgo: don't report inconsistency error for incomplete typedef
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>
2018-07-18 04:17:51 +00:00
Rob Pike
0d93758222 doc/gopher: add model sheet
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/124615
Reviewed-by: Andrew Gerrand <adg@golang.org>
2018-07-18 04:00:10 +00:00
Russ Cox
e161b1e8ee cmd/go/internal/module: allow v0.0.0 pseudoversion for gopkg.in/check.v1
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>
2018-07-18 02:09:03 +00:00
Russ Cox
56deebb3e4 cmd/go: add clean -modcache
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>
2018-07-18 02:09:01 +00:00
Russ Cox
30678788b2 cmd/go/internal/modfetch: make subdirectories unwritable too
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>
2018-07-18 02:09:00 +00:00
Russ Cox
5c622a5bf3 cmd/go/internal/modfetch: restrict file names in zip files, avoid case-insensitive collisions
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>
2018-07-18 02:08:59 +00:00
Russ Cox
5760ffc7ef cmd/go/internal/modfetch: do not rely on file system for case sensitivity
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>
2018-07-18 02:08:58 +00:00
Russ Cox
203c16592b cmd/go/internal/module: define fs-safe module path encoding
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>
2018-07-18 02:08:57 +00:00
EduRam
ce09ce4ae0 syscall: update check for UserNS support for CentOS 7.5+
Fixes #26385

Change-Id: I5594564f42898a71d30531e5132bddb3a6915247
GitHub-Last-Rev: fbd7b38b04
GitHub-Pull-Request: golang/go#26427
Reviewed-on: https://go-review.googlesource.com/124555
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-18 01:16:24 +00:00
Ian Lance Taylor
f3cdc94154 cmd/go: search test imports when matching -coverpkg
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>
2018-07-17 22:22:37 +00:00
Rob Pike
3a28a711db doc: improve the garbage collection discussion
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/124475
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-17 22:02:35 +00:00
Austin Clements
92e03bbaa8 doc/go1.11: compiler and runtime release notes
Change-Id: I487bdf0c828d28b2122bd93934dc5a9a5dbc6a00
Reviewed-on: https://go-review.googlesource.com/124517
Reviewed-by: Austin Clements <austin@google.com>
2018-07-17 21:51:00 +00:00
Austin Clements
61a04474e2 doc/go1.11: fix some typos
Change-Id: I3c0cb9b56776d8cc78a96ef012385c31f9f0e146
Reviewed-on: https://go-review.googlesource.com/124516
Reviewed-by: Austin Clements <austin@google.com>
2018-07-17 21:50:45 +00:00
Mostyn Bramley-Moore
940811922f path/filepath: make Walk example runnable in the playground
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>
2018-07-17 21:26:47 +00:00
Filippo Valsorda
a80a7f0e77 doc: minor go1.11 changes
CL 124135 follow-ups.

Change-Id: Ib7e2066bd2d18851561e03386709a1b42b50fcef
Reviewed-on: https://go-review.googlesource.com/124136
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-07-17 19:46:22 +00:00
Frank Schroeder
b9a764ffdf cmd/go: run git log with --no-show-signature
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: 96f988c0a2
GitHub-Pull-Request: golang/go#26389
Reviewed-on: https://go-review.googlesource.com/123958
Reviewed-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>
2018-07-17 18:04:14 +00:00
Steeve Morin
5419e7a09d cmd/cgo: update JNI's jobject to uintptr check for newer Android NDKs
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: 42037c3c58
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>
2018-07-17 16:51:15 +00:00
Alberto Donizetti
bccbf59046 doc/go1.11: explain new vet typechecking behaviour in release notes
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/121455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-07-17 16:44:23 +00:00