]> Cypherpunks repositories - gostls13.git/log
gostls13.git
7 years agoos: mention the influence of umask in docs
Matthijs Kooijman [Wed, 13 Dec 2017 15:45:09 +0000 (16:45 +0100)]
os: mention the influence of umask in docs

Change-Id: Ia05fac3298334d6b44267ce02bffcd7bf8a54c72
Reviewed-on: https://go-review.googlesource.com/83775
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/dist: let misc/cgo/testshared test timeout be scaled by slow builder
Brad Fitzpatrick [Fri, 15 Dec 2017 16:34:39 +0000 (16:34 +0000)]
cmd/dist: let misc/cgo/testshared test timeout be scaled by slow builder

The default test timeout is 10 minutes if unspecified.

The misc/cgo/testshared test didn't use t.timeout(sec), which respects
GO_TEST_TIMEOUT_SCALE, so all builders got the default 10 minute
timeout. arm5 needs more, though, so specify 10 minutes explicitly,
which will then get scaled accordingly on slower builders.

Change-Id: I19ecfdcd9c865f2b69524484415b8fbd2852718e
Reviewed-on: https://go-review.googlesource.com/84315
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agocmd/compile: fixes for bad DWARF abstract origin references
Than McIntosh [Mon, 11 Dec 2017 20:53:31 +0000 (15:53 -0500)]
cmd/compile: fixes for bad DWARF abstract origin references

Change the compiler's DWARF inline info generation to be more careful
about producing consistent instances of abstract function DIEs. The
new strategy is to insure that the only params/variables created in an
abstract subprogram DIE are those corresponding to declarations in the
original pre-inlining version of the code. If a concrete subprogram
winds up with other vars as part of the compilation process (return
temps, for example, or scalars generated by splitting a structure into
pieces) these are emitted as regular param/variable DIEs instead of
concrete DIEs.

The linker dwarf test now has a couple of new testpoints that include
checks to make sure that all abstract DIE references are
sane/resolvable; this will help catch similar problems in the future.

Fixes #23046.

Change-Id: I9b0030da8673fbb80b7ad50461fcf8c6ac823a37
Reviewed-on: https://go-review.googlesource.com/83675
Run-TryBot: Than McIntosh <thanm@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agoruntime: symbolize morestack caller in throwsplit panic
Austin Clements [Thu, 14 Dec 2017 20:32:12 +0000 (15:32 -0500)]
runtime: symbolize morestack caller in throwsplit panic

This attempts to symbolize the PC of morestack's caller when there's a
stack split at a bad time. The stack trace starts at the *caller* of
the function that attempted to grow the stack, so this is useful if it
isn't obvious what's being called at that point, such as in #21431.

Change-Id: I5dee305d87c8069611de2d14e7a3083d76264f8f
Reviewed-on: https://go-review.googlesource.com/84115
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc/debugging_with_gdb: update -gcflags usage
Hana Kim [Thu, 14 Dec 2017 21:11:03 +0000 (16:11 -0500)]
doc/debugging_with_gdb: update -gcflags usage

After go1.10, compiler/linker option flags apply only to the packages
listed directly on the command line unless the matching pattern is
specified. For debugging, we want to apply the flags to all packages.

Change-Id: Ic69eee1491b1080fc140592f200c59a6e03d87ac
Reviewed-on: https://go-review.googlesource.com/84135
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/dist: increase default cmd/go test timeout
Brad Fitzpatrick [Fri, 15 Dec 2017 01:49:04 +0000 (01:49 +0000)]
cmd/dist: increase default cmd/go test timeout

cmd/go has grown slow, even in short mode, and it's now regularly
failing on a number of builders where it's taking over the previous 3
minute timeout. for now, give it more time.

Change-Id: If565baf71c2770880b2e2139b47e03433951331f
Reviewed-on: https://go-review.googlesource.com/84235
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agogo/types: collect methods with parenthesized receiver types
Robert Griesemer [Thu, 14 Dec 2017 06:49:23 +0000 (22:49 -0800)]
go/types: collect methods with parenthesized receiver types

The existing code simply dropped them on the floor. Don't do that.

Fixes #23130.

Change-Id: I10f20e41f2c466a76519983253f87af7cf6d5e70
Reviewed-on: https://go-review.googlesource.com/83918
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
7 years agocmd/compile/internal/ssa: group dump files alphabetically
Geoff Berry [Thu, 14 Dec 2017 18:35:59 +0000 (13:35 -0500)]
cmd/compile/internal/ssa: group dump files alphabetically

Change dump file names to group them alphabetically in directory
listings, in pass run order.

Change-Id: I8070578a5b4a3a7983dcc527ea1cfdb10a6d7d24
Reviewed-on: https://go-review.googlesource.com/83958
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/vet: limit printf check to known Printf-like functions
Russ Cox [Wed, 13 Dec 2017 19:45:50 +0000 (14:45 -0500)]
cmd/vet: limit printf check to known Printf-like functions

The name-based heuristics fail too often to be on during "go test",
but we really want the printf vet check in "go test", so change to
a list of exactly which standard library functions are print-like.

For a later release we'd like to bring back checking for user-defined
wrappers, but in a completely precise way. Not for Go 1.10, though.

The new, more precise list includes t.Skipf, which caught some
mistakes in standard library tests.

Fixes #22936.

Change-Id: I110448e3f6b75afd4327cf87b6abb4cc2021fd0d
Reviewed-on: https://go-review.googlesource.com/83838
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/go: vet support for upcoming cmd/vet fixes
Russ Cox [Wed, 13 Dec 2017 19:39:40 +0000 (14:39 -0500)]
cmd/go: vet support for upcoming cmd/vet fixes

Two minor changes to allow fixes in cmd/vet's printf checking.

1. Pass package import path in vet config, so that vet knows
whether it is, for example, vetting "fmt".

2. Add new, but undocumented and for now unsupported
flag -vettool to control which vet binary is invoked during go vet.
This lets the cmd/vet tests build and test a throwaway vet.exe
using cmd/go to ensure type checking information, all without
installing a potentially buggy cmd/vet.

For #22936.

Change-Id: I18df7c796ebc711361c847c63eb3ee17fb041ff7
Reviewed-on: https://go-review.googlesource.com/83837
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agohtml/template: add srcset content type
Mike Samuel [Sun, 19 Nov 2017 21:37:07 +0000 (06:37 +0900)]
html/template: add srcset content type

Srcset is largely the same as a URL, but is escaped in URL contexts.
Inside a srcset attribute, URLs have their commas percent-escaped to
avoid having the URL be interpreted as multiple URLs.  Srcset is placed
in a srcset attribute literally.

Fixes #17441

Change-Id: I676b544784c7e54954ddb91eeff242cab25d02c4
Reviewed-on: https://go-review.googlesource.com/38324
Reviewed-by: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Mike Samuel <mikesamuel@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/go: do not let test vet failures stop reporting of later test results
Russ Cox [Thu, 14 Dec 2017 02:11:47 +0000 (21:11 -0500)]
cmd/go: do not let test vet failures stop reporting of later test results

(This only manifested in test vet failures for packages without tests,
or else we'd probably have seen this sooner.)

Fixes #23047.

Change-Id: I41d09a7780999bbe1951377ffcc811ba86ea5000
Reviewed-on: https://go-review.googlesource.com/83955
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc: make it clear which pprof package is used
JBD [Wed, 13 Dec 2017 23:57:46 +0000 (15:57 -0800)]
doc: make it clear which pprof package is used

Updates #22027.

Change-Id: I5a5bae77a744c7a2ecb75172846e6461a98ee8af
Reviewed-on: https://go-review.googlesource.com/83916
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agodoc/go1.10: note that netbsd/arm is definitely broken
Brad Fitzpatrick [Wed, 13 Dec 2017 21:18:28 +0000 (21:18 +0000)]
doc/go1.10: note that netbsd/arm is definitely broken

Remove the ambiguity, know that we know it's actually broken,
per https://github.com/golang/go/issues/23073#issuecomment-351045421

Updates #23073

Change-Id: I9b904da2f4c7105a0727d2a9056aaa6895d3dadc
Reviewed-on: https://go-review.googlesource.com/83856
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agoA+C: automated updates for Go 1.10
Brad Fitzpatrick [Wed, 13 Dec 2017 22:11:57 +0000 (22:11 +0000)]
A+C: automated updates for Go 1.10

Add Adam Thomason (individual CLA)
Add Adrian Hesketh (individual CLA)
Add Aeneas Rekkas (arekkas) (individual CLA)
Add Afanasev Stanislav (individual CLA)
Add Agniva De Sarker (individual CLA)
Add Alexander Pantyukhin (individual CLA)
Add Alexandre Parentea (individual CLA)
Add Aman Gupta (individual CLA)
Add Anand K. Mistry (individual CLA)
Add Andrii Soldatenko (individual CLA)
Add Andrii Soluk (individual CLA)
Add Andrzej Żeżel (individual CLA)
Add Anthony Alves (individual CLA)
Add Anthony Sottile (individual CLA)
Add Ariel Mashraki (individual CLA)
Add Axel Wagner (individual CLA)
Add Ben Haines (individual CLA)
Add Ben Laurie (corporate CLA for Google Inc.)
Add Ben Schwartz (corporate CLA for Google Inc.)
Add Blain Smith (individual CLA)
Add Blake Mesdag (individual CLA)
Add Borja Clemente (individual CLA)
Add Brett Merrill (individual CLA)
Add Brian Kessler (individual CLA)
Add Burak Guven (individual CLA)
Add Cholerae Hu (individual CLA)
Add Chris Ball (individual CLA)
Add Christian Alexander (individual CLA)
Add Christopher Henderson (individual CLA)
Add Christopher Koch (corporate CLA for Google Inc.)
Add Christos Zoulas (individual CLA)
Add Daniela Petruzalek (individual CLA)
Add Danny Rosseau (individual CLA)
Add Davor Kapsa (individual CLA)
Add Edan Bedrik (individual CLA)
Add Elbert Fliek (individual CLA)
Add Elena Grahovac (individual CLA)
Add Emerson Lin (individual CLA)
Add Eric Rescorla (individual CLA)
Add Evan Jones (individual CLA)
Add Frank Somers (individual CLA)
Add Frederic Guillot (individual CLA)
Add Garret Kelly (corporate CLA for Google Inc.)
Add Grant Griffiths (individual CLA)
Add Guilherme Garnier (individual CLA)
Add Guilherme Rezende (individual CLA)
Add Hanjun Kim (individual CLA)
Add Henry Adi Sumarto (individual CLA)
Add Henry Bubert (individual CLA)
Add Herbie Ong (corporate CLA for Google Inc.)
Add Hilko Bengen (individual CLA)
Add Hiroaki Nakamura (individual CLA)
Add Ian Kent (individual CLA)
Add Inanc Gumus (individual CLA)
Add Iskander Sharipov (corporate CLA for Intel Corporation)
Add Ivan Bertona (individual CLA)
Add James Lawrence (individual CLA)
Add James Treanor (individual CLA)
Add Jamie Liu (corporate CLA for Google Inc.)
Add Jared Culp (individual CLA)
Add Jason Wangsadinata (individual CLA)
Add Javier Segura (individual CLA)
Add Jean-Francois Cantin (individual CLA)
Add Jeet Parekh (individual CLA)
Add Jelte Fennema (individual CLA)
Add Jimmy Frasche (individual CLA)
Add Joshua Rubin (individual CLA)
Add Juan Carlos (individual CLA)
Add Jude Pereira (individual CLA)
Add Karel Pazdera (individual CLA)
Add Karsten Köhler (individual CLA)
Add Kenji Yano (individual CLA)
Add Kevin Ruffin (individual CLA)
Add Kieran Colford (individual CLA)
Add Kirk Han (individual CLA)
Add Kunpei Sakai (individual CLA)
Add Kyle Shannon (individual CLA)
Add Kyohei Kadota (individual CLA)
Add Lakshay Garg (individual CLA)
Add Lann Martin (corporate CLA for Google Inc.)
Add Laurent Voisin (individual CLA)
Add Leigh McCulloch (individual CLA)
Add Lorenz Bauer (corporate CLA for CloudFlare, Inc.)
Add Luca Bruno (corporate CLA for CoreOS, Inc)
Add Luke Granger-Brown (individual CLA)
Add Lyle Franklin (individual CLA)
Add Maicon Costa (individual CLA)
Add Manish Goregaokar (individual CLA)
Add Mansour Rahimi (individual CLA)
Add Mark Percival (individual CLA)
Add Mark Pulford (individual CLA)
Add Mark Wolfe (individual CLA)
Add Martins Sipenko (individual CLA)
Add Mat Byczkowski (individual CLA)
Add Matej Baćo (individual CLA)
Add Mateus Amin (individual CLA)
Add Matt Dee (individual CLA)
Add Matthew Broberg (individual CLA)
Add Max Schmitt (individual CLA)
Add Mayank Kumar (individual CLA)
Add Michael Brandenburg (individual CLA)
Add Michael McLoughlin (individual CLA)
Add Michael Schurter (individual CLA)
Add Michael Steinert (individual CLA)
Add Michal Pristas (individual CLA)
Add Mihail Minaev (individual CLA)
Add Muhammad Falak R Wani (individual CLA)
Add Naoki Kanatani (individual CLA)
Add Nicolas BRULEZ (individual CLA)
Add Nils Larsgård (individual CLA)
Add Noble Johnson (individual CLA)
Add Paul Boyd (individual CLA)
Add Paul Ruest (individual CLA)
Add Peter Wu (corporate CLA for CloudFlare, Inc.)
Add Petrica Voicu (individual CLA)
Add Pontus Leitzler (individual CLA)
Add Radek Sohlich (individual CLA)
Add Rajath Agasthya (individual CLA)
Add Rajender Reddy Kompally (individual CLA)
Add Ramazan AYYILDIZ (individual CLA)
Add RaviTeja Pothana (individual CLA)
Add Reilly Watson (individual CLA)
Add Roman Budnikov (individual CLA)
Add Ross Chater (individual CLA)
Add Rudi Kramer (individual CLA)
Add Ryoichi KATO (individual CLA)
Add Ryuji Iwata (individual CLA)
Add Scott Crunkleton (individual CLA)
Add Seiji Takahashi (individual CLA)
Add Sergey Frolov (corporate CLA for Google Inc.)
Add Sergey Semin (individual CLA)
Add Sergiusz Bazanski (individual CLA)
Add Stanislav Afanasev (individual CLA)
Add Sukrit Handa (individual CLA)
Add Sylvain Zimmer (individual CLA)
Add Tao Wang (individual CLA)
Add Terin Stock (individual CLA)
Add Thiago Avelino (individual CLA)
Add Thomas Wanielista (individual CLA)
Add Tim Cooper (individual CLA)
Add Tim Wright (individual CLA)
Add Tobias Assarsson (individual CLA)
Add Tom Lanyon (corporate CLA for Google Inc.)
Add Tom Levy (individual CLA)
Add Troels Thomsen (individual CLA)
Add Tugdual Saunier (individual CLA)
Add Tyler Bui-Palsulich (corporate CLA for Google Inc.)
Add Wembley G. Leach, Jr (individual CLA)
Add Will Faught (individual CLA)
Add Wèi Cōngruì (individual CLA)
Add Xi Ruoyao (individual CLA)
Add Yann Salaün (individual CLA)
Add Yosuke Akatsuka (individual CLA)
Add Zach Gershman (individual CLA)
Add Zhengyu He (corporate CLA for Google Inc.)
Add Zhongtao Chen (individual CLA)
Add Роман Хавроненко (individual CLA)
Add Тарас Буник (individual CLA)

Updates #12042

Change-Id: If8fd708d32434b8ba21a0b3ef433b0d176626ce8
Reviewed-on: https://go-review.googlesource.com/83858
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agodoc/go1.10: fix formatting of 'go tool fix' examples
Tobias Klauser [Thu, 14 Dec 2017 09:48:53 +0000 (10:48 +0100)]
doc/go1.10: fix formatting of 'go tool fix' examples

Also remove a superfluous </p>

Change-Id: Idca51cdfbd8abc6669f00c80ca3fb7f225ee445c
Reviewed-on: https://go-review.googlesource.com/84015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agotesting: do not crash when m.Run is called twice and -test.testlogfile is used
Russ Cox [Thu, 14 Dec 2017 02:46:03 +0000 (21:46 -0500)]
testing: do not crash when m.Run is called twice and -test.testlogfile is used

Tests exist that call m.Run in a loop‽
Now we have one too.

Fixes #23129.

Change-Id: I8cbecb724f239ae14ad45d75e67d12c80e41c994
Reviewed-on: https://go-review.googlesource.com/83956
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agoos: don't wait for Close if the File was returned by NewFile
Wèi Cōngruì [Thu, 14 Dec 2017 02:54:11 +0000 (10:54 +0800)]
os: don't wait for Close if the File was returned by NewFile

os.NewFile doesn't put the fd into non-blocking mode.
In most cases, an *os.File returned by os.NewFile is in blocking mode.

Updates #7970
Updates #21856
Updates #23111

Change-Id: Iab08432e41f7ac1b5e25aaa8855d478adb7f98ed
Reviewed-on: https://go-review.googlesource.com/83995
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/cgo: don't define intgo in export prologue
Ian Lance Taylor [Thu, 14 Dec 2017 01:29:28 +0000 (17:29 -0800)]
cmd/cgo: don't define intgo in export prologue

The export prologue goes into the _cgo_export.h file, where it may be
be #include'd by a .swig file. As SWIG defines its own type "intgo",
the definition of "intgo" in the export prologue could conflict.
Since we don't need to define "intgo" in the _cgo_export.h file, don't.

Defining "intgo" in _cgo_export.h was new for this release, so this
should not break any existing code.

No test case as I can't quite bring myself to write a test that
combines SWIG and cgo.

Change-Id: I8073e8300a1860cecd5994b9ad07dd35a4298c89
Reviewed-on: https://go-review.googlesource.com/83936
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agotesting: emphasize that Fatal/FailNow/etc run deferred calls
Russ Cox [Thu, 14 Dec 2017 01:08:03 +0000 (20:08 -0500)]
testing: emphasize that Fatal/FailNow/etc run deferred calls

Fixes #22989.

Change-Id: I9776a7b0d0598c2cb118c323d1f8f933665da254
Reviewed-on: https://go-review.googlesource.com/83881
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
7 years agotesting: define Run result a little more clearly
Russ Cox [Thu, 14 Dec 2017 01:04:43 +0000 (20:04 -0500)]
testing: define Run result a little more clearly

t.Run(f) does not wait for f after f calls t.Parallel.
Otherwise it would be impossible to create new
parallel sibling subtests for f.

Fixes #22993.

Change-Id: I27e1555ab1ff608eb8155db261d5e7ee8f486aef
Reviewed-on: https://go-review.googlesource.com/83880
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/go: apply same per-package flags to compile and link of test
Russ Cox [Thu, 14 Dec 2017 00:47:32 +0000 (19:47 -0500)]
cmd/go: apply same per-package flags to compile and link of test

If package strings has a particular set of gcflags, then the strings_test
pseudo-package built as part of the test binary started inheriting the
same flags in CL 81496, to fix #22831.

Now the package main and final test binary link built as part of the
strings test binary also inherit the same flags, to fix #22994.

I am slightly uneasy about reusing package strings's flags for
package main, but the alternative would be to introduce some
kind of special case, which I'd be even more uneasy about.

This interpretation preserves the Go 1.9 behavior of existing
commands like:

go test -c -ldflags=-X=mypkg.debugString=foo mypkg

Fixes #22994.

Change-Id: I9ab83bf1a9a6adae530a7715b907e709fd6c1b5d
Reviewed-on: https://go-review.googlesource.com/83879
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet, os: don't wait for Close in blocking mode
Ian Lance Taylor [Wed, 13 Dec 2017 14:32:06 +0000 (06:32 -0800)]
net, os: don't wait for Close in blocking mode

Updates #7970
Updates #21856
Updates #23111

Change-Id: I0cd0151fcca740c40c3c976f941b04e98e67b0bf
Reviewed-on: https://go-review.googlesource.com/83715
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agogo/types: remove TODOs from API that cannot be changed (cleanup)
Robert Griesemer [Thu, 14 Dec 2017 00:40:39 +0000 (16:40 -0800)]
go/types: remove TODOs from API that cannot be changed (cleanup)

Change-Id: I4e357a250b2f9cfbf780b05c5f54805682b19a62
Reviewed-on: https://go-review.googlesource.com/83935
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
7 years agodoc: add some links to the diagnostics page
JBD [Thu, 14 Dec 2017 00:03:19 +0000 (16:03 -0800)]
doc: add some links to the diagnostics page

Updates #22027.

Change-Id: I468348d2b000f146f88ef8b7cf450eea8d1c12a7
Reviewed-on: https://go-review.googlesource.com/83917
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agotest: skip "# package/path" output from cmd/go in errchk
Russ Cox [Wed, 13 Dec 2017 19:38:58 +0000 (14:38 -0500)]
test: skip "# package/path" output from cmd/go in errchk

This allows errchk to be used with "go vet" output (as opposed to "go tool vet").

Change-Id: I0009a53c9cb74accd5bd3923c137d6dbf9e46326
Reviewed-on: https://go-review.googlesource.com/83836
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agoall: fix t.Skipf formats
Russ Cox [Wed, 13 Dec 2017 19:57:44 +0000 (14:57 -0500)]
all: fix t.Skipf formats

Found by upcoming cmd/vet change.

Change-Id: I7a8264a304b2a4f26f3bd418c1b28cc849889c9b
Reviewed-on: https://go-review.googlesource.com/83835
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocrypto/x509: load all trusted certs on darwin (cgo)
Nathaniel Caza [Tue, 14 Feb 2017 03:15:40 +0000 (21:15 -0600)]
crypto/x509: load all trusted certs on darwin (cgo)

The current implementation ignores certs wherein the
Subject does not match the Issuer. An example of where
this causes issue is an enterprise environment with
intermediate CAs. In this case, the issuer is separate
(and may be loaded) but the intermediate is ignored.
A TLS handshake that does not include the intermediate
cert would then fail with an untrusted error in Go.

On other platforms (darwin-nocgo included), all trusted
certs are loaded and accepted reguardless of
Subject/Issuer names.

This change removes the Subject/Issuer name-matching
restriction of certificates when trustAsRoot is set,
allowing all trusted certs to be loaded on darwin (cgo).

Refs #16532

Change-Id: I451e929588f8911892be6bdc2143d0799363c5f8
Reviewed-on: https://go-review.googlesource.com/36942
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: update info about flame graphs in diagnostics.html
Hana Kim [Wed, 13 Dec 2017 17:59:12 +0000 (12:59 -0500)]
doc: update info about flame graphs in diagnostics.html

Use Brendan Gregg's FlameGraphs page link.
Mention the flame graph is available from the upstream pprof.

Change-Id: Ife1d5a5f4f93f20cd5952a09083f798b77d25a60
Reviewed-on: https://go-review.googlesource.com/83798
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc/go1.10: preannounce deprecation of OS X 10.9 Mavericks
Russ Cox [Wed, 13 Dec 2017 16:00:14 +0000 (11:00 -0500)]
doc/go1.10: preannounce deprecation of OS X 10.9 Mavericks

By the time Go 1.11 is released, OS X 10.9 Mavericks will have gone
two years with no security updates.

For #23011.

Change-Id: I6482852a14477985769b72c45c92416aae8be100
Reviewed-on: https://go-review.googlesource.com/83795
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agotime: add space padding layout strings(using underscore) for not only day but others
Hanjun Kim [Mon, 20 Nov 2017 05:23:06 +0000 (14:23 +0900)]
time: add space padding layout strings(using underscore) for not only day but others

As mentioned in #22802, only day component of layout string has space
padding(represented by one underscore before its placeholder). This
commit expands the rule for month, hour, minute and second.

Updates #22802 (maybe fixes it)

Change-Id: I886998380489862ab9a324a6774f2e4cf7124122
Reviewed-on: https://go-review.googlesource.com/78735
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
7 years agocmd/go: don't use a testlog if there is an exec command
Ian Lance Taylor [Wed, 13 Dec 2017 01:41:49 +0000 (17:41 -0800)]
cmd/go: don't use a testlog if there is an exec command

An exec command is normally used on platforms were the test is run in
some unusual way, making it less likely that the testlog will be useful.

Updates #22593

Change-Id: I0768f6da89cb559d8d675fdf6d685db9ecedab9e
Reviewed-on: https://go-review.googlesource.com/83578
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc/go1.10: note that plugin now works on darwin/amd64
Brad Fitzpatrick [Wed, 13 Dec 2017 01:20:02 +0000 (01:20 +0000)]
doc/go1.10: note that plugin now works on darwin/amd64

Fixes #23085

Change-Id: I7fef281079e9e08c49ae05371506b0b881a467db
Reviewed-on: https://go-review.googlesource.com/83577
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/compile: remove broken inlining accounting code
Matthew Dempsky [Tue, 12 Dec 2017 19:13:49 +0000 (11:13 -0800)]
cmd/compile: remove broken inlining accounting code

We can't currently inline functions that contain closures anyway, so
just delete this budgeting code for now. Re-enable once we can (if
ever) inline functions with nested closures.

Updates #15561.
Fixes #23093.

Change-Id: Idc5f8e042ccfcc8921022e58d3843719d4ab821e
Reviewed-on: https://go-review.googlesource.com/83538
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years agocmd/link: with -importcfg don't strip trailing ".a"
Ian Lance Taylor [Tue, 5 Dec 2017 07:10:56 +0000 (23:10 -0800)]
cmd/link: with -importcfg don't strip trailing ".a"

When using -importcfg, the import paths recorded by the compiler in
the object file are simply the import paths. When not using -importcfg,
the import paths have a trailing ".a". Assume that if we are using
-importcfg with the compiler, we are using it with the linker,
and so if the linker sees an -importcfg option it should not
strip ".a" from the import path read from the object files.

This was mostly working because the linker only strips a trailing
".x" for a literal dot and any single character 'x'. Since few import
paths end with ".x", most programs worked fine.

Fixes #22986

Change-Id: I6c10a160b97dd63fff3931f27a1514c856e8cd52
Reviewed-on: https://go-review.googlesource.com/81878
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agocmd/go: remove file created by test
Ian Lance Taylor [Mon, 11 Dec 2017 23:08:19 +0000 (15:08 -0800)]
cmd/go: remove file created by test

The file cmd/go/testdata/src/testcache/script.sh was accidentally
committed with CL 83256. Sorry about that.

Updates #22593

Change-Id: Id8f07587ea97015ed75439db220560a5446e53e6
Reviewed-on: https://go-review.googlesource.com/83395
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agoos: don't use test logger for Getwd
Ian Lance Taylor [Tue, 12 Dec 2017 00:41:37 +0000 (16:41 -0800)]
os: don't use test logger for Getwd

Otherwise, on systems for which syscall does not implement Getwd,
a lot of unnecessary files and directories get added to the testlog,
right up the root directory. This was causing tests on such systems
to fail to cache in practice.

Updates #22593

Change-Id: Ic8cb3450ea62aa0ca8eeb15754349f151cd76f85
Reviewed-on: https://go-review.googlesource.com/83455
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agoplugin: document support for macOS
David Crawshaw [Sat, 23 Sep 2017 15:55:02 +0000 (11:55 -0400)]
plugin: document support for macOS

All plugins issues I would call bugs now closed, so
(with some amount of optimism) update the plugin documentation.

Change-Id: Ia421c18a166d7cdf599ac86f2336541c1ef42a0d
Reviewed-on: https://go-review.googlesource.com/65670
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/go: remove script.sh in TestTestCacheInputs
Ian Lance Taylor [Mon, 11 Dec 2017 20:11:19 +0000 (12:11 -0800)]
cmd/go: remove script.sh in TestTestCacheInputs

Updates #22593

Change-Id: I76e52dc8b874da13ae9e2d80e5c0d6d8424b67db
Reviewed-on: https://go-review.googlesource.com/83257
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/go: don't pass -test.testlogfile on NaCl
Ian Lance Taylor [Mon, 11 Dec 2017 19:28:50 +0000 (11:28 -0800)]
cmd/go: don't pass -test.testlogfile on NaCl

It causes every test to fail as the log file is on the local file system,
not the NaCl file system.

Updates #22593

Change-Id: Iee3d8307317bd792c9c701baa962ebbbfa34c147
Reviewed-on: https://go-review.googlesource.com/83256
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/api: don’t rely on hardcoded go versions
Andrew Bonventre [Mon, 11 Dec 2017 21:21:07 +0000 (16:21 -0500)]
cmd/api: don’t rely on hardcoded go versions

Instead of requiring that cmd/api/run.go be edited upon each
release to include the next Go version number, look in $GOROOT/api
for files with the prefix go1* and use those instead to perform
API checks.

Change-Id: I5d9407f2bd368ff5e62f487cccdd245641ca9c9b
Reviewed-on: https://go-review.googlesource.com/83355
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc/contrib.html: fix outdated link
Stanislav Afanasev [Mon, 11 Dec 2017 20:45:19 +0000 (23:45 +0300)]
doc/contrib.html: fix outdated link

Change-Id: I6d94a14a781a2fbeb90db35ae3490ce2ac5f8ed1
Reviewed-on: https://go-review.googlesource.com/83315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: change “substantial” to “significant”
Andrew Bonventre [Mon, 11 Dec 2017 22:05:14 +0000 (17:05 -0500)]
doc: change “substantial” to “significant”

Change-Id: Ie7f2890eab9ad82da93babc92380b13c611af3d0
Reviewed-on: https://go-review.googlesource.com/83375
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agodoc: fix misuse of “substantive” in 1.10 release notes
Andrew Bonventre [Mon, 11 Dec 2017 21:42:25 +0000 (16:42 -0500)]
doc: fix misuse of “substantive” in 1.10 release notes

Use “substantial”, which is believed to be the correct word.
Additionally, this change strips trailing whitespace from the file.

Change-Id: I5b6b718fc09e4b8b911b95e8be0733abd58e165d
Reviewed-on: https://go-review.googlesource.com/83356
Reviewed-by: Andrew Gerrand <adg@golang.org>
7 years agostrings: fix two Builder bugs allowing mutation of strings, remove ReadFrom
Brad Fitzpatrick [Mon, 11 Dec 2017 15:41:24 +0000 (15:41 +0000)]
strings: fix two Builder bugs allowing mutation of strings, remove ReadFrom

The Builder's ReadFrom method allows the underlying unsafe slice to
escape, and for callers to subsequently modify memory that had been
unsafely converted into an immutable string.

In the original proposal for Builder (#18990), I'd noted there should
be no Read methods:

> There would be no Reset or Bytes or Truncate or Read methods.
> Nothing that could mutate the []byte once it was unsafely converted
> to a string.

And in my prototype (https://golang.org/cl/37767), I handled ReadFrom
properly, but when https://golang.org/cl/74931 arrived, I missed that
it had a ReadFrom method and approved it.

Because we're so close to the Go 1.10 release, just remove the
ReadFrom method rather than think about possible fixes. It has
marginal utility in a Builder anyway.

Also, fix a separate bug that also allowed mutation of a slice's
backing array after it had been converted into a slice by disallowing
copies of the Builder by value.

Updates #18990
Fixes #23083
Fixes #23084

Change-Id: Id1f860f8a4f5f88b32213cf85108ebc609acb95f
Reviewed-on: https://go-review.googlesource.com/83255
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/go: invalidate cached test results if env vars or files change
Russ Cox [Mon, 4 Dec 2017 18:57:48 +0000 (13:57 -0500)]
cmd/go: invalidate cached test results if env vars or files change

When we write a cached test result, we now also write a log of the
environment variables and files inspected by the test run,
along with a hash of their content. Before reusing a cached test result,
we recompute the hash of the content specified by the log, and only
use the result if that content has not changed.

This makes test caching behave correctly for tests that consult
environment variables or stat or read files or directories.

Fixes #22593.

Change-Id: I8608798e73c90e0c1911a38bf7e03e1232d784dc
Reviewed-on: https://go-review.googlesource.com/81895
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agointernal/poll: fix error in increfAndClose documentation
Wèi Cōngruì [Mon, 11 Dec 2017 03:17:34 +0000 (11:17 +0800)]
internal/poll: fix error in increfAndClose documentation

Change-Id: I0c387b6286bc18fd00c6ac4e42bdf175cf89ccb1
Reviewed-on: https://go-review.googlesource.com/83155
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agoruntime: reset write barrier buffer on all flush paths
Austin Clements [Fri, 8 Dec 2017 22:32:23 +0000 (17:32 -0500)]
runtime: reset write barrier buffer on all flush paths

Currently, wbBufFlush does nothing if the goroutine is dying on the
assumption that the system is crashing anyway and running the write
barrier may crash it even more. However, it fails to reset the
buffer's "next" pointer. As a result, if there are later write
barriers on the same P, the write barrier will overflow the write
barrier buffer and start corrupting other fields in the P or other
heap objects. Often, this corrupts fields in the next allocated P
since they tend to be together in the heap.

Fix this by always resetting the buffer's "next" pointer, even if
we're not doing anything with the pointers in the buffer.

Updates #22987 and #22988. (May fix; it's hard to say.)

Change-Id: I82c11ea2d399e1658531c3e8065445a66b7282b2
Reviewed-on: https://go-review.googlesource.com/83016
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
7 years agoruntime: mark heapBits.bits nosplit
Austin Clements [Fri, 8 Dec 2017 22:12:41 +0000 (17:12 -0500)]
runtime: mark heapBits.bits nosplit

heapBits.bits is used during bulkBarrierPreWrite via
heapBits.isPointer, which means it must not be preempted. If it is
preempted, several bad things can happen:

1. This could allow a GC phase change, and the resulting shear between
the barriers and the memory writes could result in a lost pointer.

2. Since bulkBarrierPreWrite uses the P's local write barrier buffer,
if it also migrates to a different P, it could try to append to the
write barrier buffer concurrently with another write barrier. This can
result in the buffer's next pointer skipping over its end pointer,
which results in a buffer overflow that can corrupt arbitrary other
fields in the Ps (or anything in the heap, really, but it'll probably
crash from the corrupted P quickly).

Fix this by marking heapBits.bits go:nosplit. This would be the
perfect use for a recursive no-preempt annotation (#21314).

This doesn't actually affect any binaries because this function was
always inlined anyway. (I discovered it when I was modifying heapBits
and make h.bits() no longer inline, which led to rampant crashes from
problem 2 above.)

Updates #22987 and #22988 (but doesn't fix because it doesn't actually
change the generated code).

Change-Id: I60ebb928b1233b0613361ac3d0558d7b1cb65610
Reviewed-on: https://go-review.googlesource.com/83015
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agodoc: update NetBSD status
Brad Fitzpatrick [Mon, 11 Dec 2017 00:37:19 +0000 (00:37 +0000)]
doc: update NetBSD status

Fixes #23073

Change-Id: Ia43b28beeff9e57579caf5dcb76146ee29d5033b
Reviewed-on: https://go-review.googlesource.com/82918
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet: skip some tests on Windows XP
Alex Brainman [Sat, 9 Dec 2017 23:35:44 +0000 (10:35 +1100)]
net: skip some tests on Windows XP

Parts of TestUDPConnSpecificMethods and TestWriteToUDP fail, because
UDPConn.WriteMsgUDP is broken on Windows XP. UDPConn.WriteMsgUDP uses
Windows WSASendMsg API, but that call is not implemented on Windows XP (see
https://msdn.microsoft.com/en-us/library/windows/desktop/ms741692(v=vs.85).aspx
for details)

Update #23072

Change-Id: I4e8f149bc62bd87cd7c199e6832b9ce479af0a3e
Reviewed-on: https://go-review.googlesource.com/83077
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agointernal/testenv: introduce IsWindowsXP
Alex Brainman [Sat, 9 Dec 2017 23:14:41 +0000 (10:14 +1100)]
internal/testenv: introduce IsWindowsXP

For #23072

Change-Id: I089feafef2900413d46f2358b6e41ab78187eced
Reviewed-on: https://go-review.googlesource.com/83076
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agoos: fix typo in TestExecutable comment
Tobias Klauser [Sat, 9 Dec 2017 11:31:41 +0000 (12:31 +0100)]
os: fix typo in TestExecutable comment

Change-Id: I2ad5d73deaee57ccbb2c75378dcc2884e43be3bb
Reviewed-on: https://go-review.googlesource.com/82899
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agoruntime: don't use MAP_STACK in SigStack test
Ian Lance Taylor [Sat, 9 Dec 2017 00:05:22 +0000 (16:05 -0800)]
runtime: don't use MAP_STACK in SigStack test

On DragonFly mmap with MAP_STACK returns the top of the region, not
the bottom. Rather than try to cope, just don't use the flag anywhere.

Fixes #23061

Change-Id: Ib5df4dd7c934b3efecfc4bc87f8989b4c37555d7
Reviewed-on: https://go-review.googlesource.com/83035
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
7 years agocmd/compile: fix unsafe.Pointer liveness for Syscall-like functions
Matthew Dempsky [Fri, 8 Dec 2017 07:04:50 +0000 (23:04 -0800)]
cmd/compile: fix unsafe.Pointer liveness for Syscall-like functions

The package unsafe docs say it's safe to convert an unsafe.Pointer to
uintptr in the argument list to an assembly function, but it was
erroneously only detecting normal pointers converted to unsafe.Pointer
and then to intptr.

Fixes #23051.

Change-Id: Id1be19f6d8f26f2d17ba815191717d2f4f899732
Reviewed-on: https://go-review.googlesource.com/82817
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet: calling File disables the SetDeadline methods
Ian Lance Taylor [Fri, 8 Dec 2017 14:40:43 +0000 (06:40 -0800)]
net: calling File disables the SetDeadline methods

This essentially applies https://golang.org/cl/81636 to the net package.

The full truth seems too complicated to write in this method's doc, so
I'm going with a simple half truth.

The full truth is that File returns the descriptor in blocking mode,
because that is historically how it worked, and existing programs
would be surprised if the descriptor is suddenly non-blocking. On Unix
systems whether a socket is non-blocking or not is a property of the
underlying file description, not of a particular file descriptor, so
changing the returned descriptor to blocking mode also changes the
existing socket to blocking mode. Blocking mode works fine, althoug I/O
operations now take up a thread. SetDeadline and friends rely on the
runtime poller, and the runtime poller only works if the descriptor is
non-blocking. So it's correct that calling File disables SetDeadline.
The other half of the truth is that if the program is willing to work
with a non-blocking descriptor, it could call
syscall.SetNonblock(f.Fd(), true) to change the descriptor, and
the original socket, to non-blocking mode. At that point SetDeadline
would start working again. I tried to write that in a way that is
short and comprehensible but failed. Since we now have the RawConn
approach to frobbing the descriptor, and hopefully most people can use
that rather than calling File, I decided to punt.

Updates #22934
Fixes #21862

Change-Id: If269da762f6f5a88c334e7b6d6f3998f7e10b11e
Reviewed-on: https://go-review.googlesource.com/82915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agonet: enable TestInterfaceHardwareAddrWithGetmac on all windows versions
Jeff Johnson [Fri, 8 Dec 2017 17:21:57 +0000 (09:21 -0800)]
net: enable TestInterfaceHardwareAddrWithGetmac on all windows versions

Re-work the test to use wmic instead of PowerShell's getmac that's
only avaliable on Server 2008. Maintains duplicate detection added
for golang/go#21027.

Tested on windows-amd64-{2008, 2012, 2016} buildlets.
Enabling for Windows XP because it should work[1].

Fixes golang/go#20073

[1] https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wmic_overview.mspx?mfr=true

Change-Id: Ic11d569f7964f61d08ae0dcc1b926efc5336ac5b
Reviewed-on: https://go-review.googlesource.com/82975
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agofix a typo in the runtime.MemStats documentation
Paul Boyd [Fri, 8 Dec 2017 17:48:26 +0000 (12:48 -0500)]
fix a typo in the runtime.MemStats documentation

Change-Id: If553950446158cee486006ba85c3663b986008a6
Reviewed-on: https://go-review.googlesource.com/82936
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet: increase timeout for TestDialerDualStackFDLeak
Ian Lance Taylor [Fri, 8 Dec 2017 15:07:45 +0000 (07:07 -0800)]
net: increase timeout for TestDialerDualStackFDLeak

This test has been getting occasional timeouts on the race builder.
The point of the test is whether a file descriptor leaks, not whether
the connection occurs in a certain amount of time. So use a very large
timeout. The connection is normally fast and the timeout doesn't matter.

Updates #13324

Change-Id: Ie1051c4a0be1fca4e63b1277101770be0cdae512
Reviewed-on: https://go-review.googlesource.com/82916
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: add doc about C types that we map to uintptr instead of ptr
Keith Randall [Fri, 8 Dec 2017 16:38:15 +0000 (08:38 -0800)]
doc: add doc about C types that we map to uintptr instead of ptr

Update #22906
Update #21897

Change-Id: I73709b2fdac6981d4bc2f7dab0767f2dd7be3be5
Reviewed-on: https://go-review.googlesource.com/82917
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/cgo: make JNI's jobject type map to uintptr in Go
Keith Randall [Tue, 5 Dec 2017 05:29:38 +0000 (21:29 -0800)]
cmd/cgo: make JNI's jobject type map to uintptr in Go

The jobject type is declared as a pointer, but some JVMs
(Dalvik, ART) store non-pointer values in them. In Go, we must
use uintptr instead of a real pointer for these types.

This is similar to the CoreFoundation types on Darwin which
were "fixed" in CL 66332.

Update #22906
Update #21897

RELNOTE=yes

Change-Id: I0d4c664501d89a696c2fb037c995503caabf8911
Reviewed-on: https://go-review.googlesource.com/81876
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc/go1.10: fix HTML start tag
Tobias Klauser [Fri, 8 Dec 2017 13:43:40 +0000 (14:43 +0100)]
doc/go1.10: fix HTML start tag

Change-Id: I33f14ea1d58e18081bae3f16c87d11312249c842
Reviewed-on: https://go-review.googlesource.com/82835
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agostrings: delete unused constant
Caleb Spare [Fri, 8 Dec 2017 10:11:05 +0000 (02:11 -0800)]
strings: delete unused constant

Change-Id: I235c5bc7ce598047eccc1518984dd27f568046a2
Reviewed-on: https://go-review.googlesource.com/82776
Run-TryBot: Caleb Spare <cespare@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agohtml/template: fix typo in TestOrphanedTemplate error message
Samuel Tan [Fri, 8 Dec 2017 06:18:50 +0000 (22:18 -0800)]
html/template: fix typo in TestOrphanedTemplate error message

This error message should reference t2, not t1.

Change-Id: I2e42b8335ca9367a1fb7f76c38a1bcf8f32a2bf3
Reviewed-on: https://go-review.googlesource.com/82816
Reviewed-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Gabriel Aszalos <gabriel.aszalos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agosync: throw, not panic, for unlock of unlocked mutex
Rhys Hiltner [Thu, 7 Dec 2017 21:38:16 +0000 (13:38 -0800)]
sync: throw, not panic, for unlock of unlocked mutex

This was originally done in https://golang.org/cl/31359 but partially
undone (apparently unintentionally) in https://golang.org/cl/34310

Fix it, and update tests to ensure the error is unrecoverable.

Fixes #23039

Change-Id: I923ebd613a05e67d8acce77f4a68c64c8574faa6
Reviewed-on: https://go-review.googlesource.com/82656
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
7 years agonet: avoid race on test hooks with DNS goroutines
Ian Lance Taylor [Fri, 8 Dec 2017 04:30:28 +0000 (20:30 -0800)]
net: avoid race on test hooks with DNS goroutines

The DNS code can start goroutines and not wait for them to complete.
This does no harm, but in tests this can cause a race condition with
the test hooks that are installed and unintalled around the tests.
Add a WaitGroup that tests of DNS can use to avoid the race.

Fixes #21090

Change-Id: I6c1443a9c2378e8b89d0ab1d6390c0e3e726b0ce
Reviewed-on: https://go-review.googlesource.com/82795
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agohtml/template: reset templates orphaned by (*Template).New
Samuel Tan [Fri, 17 Nov 2017 23:47:33 +0000 (15:47 -0800)]
html/template: reset templates orphaned by (*Template).New

If (*Template).New replaces an existing template, reset the
existing template that is going to be replaced so that any
later attempt to execute this orphaned template will fail.

Fixes #22780

Change-Id: I0e058f42c1542c86d19dc5f6c4e1e859e670a4a2
Reviewed-on: https://go-review.googlesource.com/78542
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/compile: fix large load/store offsets on 386
Keith Randall [Thu, 7 Dec 2017 22:11:19 +0000 (14:11 -0800)]
cmd/compile: fix large load/store offsets on 386

Pointer arithemetic is done mod 2^32 on 386, so we can just
drop the high bits of any large constant offsets.

The bounds check will make sure wraparounds are never observed.

Fixes #21655

Change-Id: I68ae5bbea9f02c73968ea2b21ca017e5ecb89223
Reviewed-on: https://go-review.googlesource.com/82675
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
7 years agonet/http: document ResponseWriter.WriteHeader more
Brad Fitzpatrick [Thu, 7 Dec 2017 20:08:21 +0000 (20:08 +0000)]
net/http: document ResponseWriter.WriteHeader more

Change-Id: I65209b90ed7c56d4c751b3e4b3ce1de52dae368c
Reviewed-on: https://go-review.googlesource.com/82635
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet/http: deflake TestServerCancelsReadTimeoutWhenIdle
Brad Fitzpatrick [Thu, 7 Dec 2017 19:51:08 +0000 (19:51 +0000)]
net/http: deflake TestServerCancelsReadTimeoutWhenIdle

I can reproduce with a very short timeout (fractions of a millisecond)
combined with -race.

But given that this is inherently sensitive to actual time, add a
testing mechanism to retry with increasingly large times to compensate
for busy buidlers. This also means the test is usually faster now,
too, since we can start with smaller durations.

Fixes #19608

Change-Id: I3a222464720195849da768e9801eb7b43baa4aeb
Reviewed-on: https://go-review.googlesource.com/82595
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agoruntime: make RawSyscall panic on Solaris
Brad Fitzpatrick [Thu, 7 Dec 2017 21:14:34 +0000 (21:14 +0000)]
runtime: make RawSyscall panic on Solaris

It's unused and doesn't work.

Fixes #20833

Change-Id: I09335e84c60f88dd1771f7353b0097f36a5e7660
Reviewed-on: https://go-review.googlesource.com/82636
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc: fix mistake in NetBSD notes
Brad Fitzpatrick [Thu, 7 Dec 2017 21:36:16 +0000 (21:36 +0000)]
doc: fix mistake in NetBSD notes

It's 32-bit binaries that fail for reasons unknown on 64-bit kernels.

Change-Id: Ib410af0491160e3ed8d32118966142516123db2c
Reviewed-on: https://go-review.googlesource.com/82655
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agodoc/go1.10: fix HTML close tags
Brad Fitzpatrick [Thu, 7 Dec 2017 23:27:11 +0000 (23:27 +0000)]
doc/go1.10: fix HTML close tags

Change-Id: I28ddb8cd347120c08d5b58ae20f481b60416abc1
Reviewed-on: https://go-review.googlesource.com/82755
Reviewed-by: Andrew Bonventre <andybons@golang.org>
7 years agosyscall: make Seek use SetFilePointerEx on Windows, allowing large seek offsets
Brad Fitzpatrick [Wed, 6 Dec 2017 18:20:26 +0000 (18:20 +0000)]
syscall: make Seek use SetFilePointerEx on Windows, allowing large seek offsets

Fixes #21681
Updates #21728

Change-Id: I79cf4564c1355ecab891102d4215cbbffd8eb0ce
Reviewed-on: https://go-review.googlesource.com/82535
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet/http/httputil: remove redundant call of setBody in test go1.10beta1
Joe Kyo [Thu, 7 Dec 2017 16:34:14 +0000 (16:34 +0000)]
net/http/httputil: remove redundant call of setBody in test

Change-Id: I5a38200b9e050b484ec39f47c637e651e237390d
Reviewed-on: https://go-review.googlesource.com/82536
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agodoc: fix bad html tags in editors.html
Alberto Donizetti [Thu, 7 Dec 2017 17:07:57 +0000 (18:07 +0100)]
doc: fix bad html tags in editors.html

Change-Id: Ib8ef626ae6bc66571ecf4569e37feb75b4b90d10
Reviewed-on: https://go-review.googlesource.com/82555
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/compile: fix bug in logic for computing var abstract origins
Than McIntosh [Thu, 7 Dec 2017 01:10:51 +0000 (20:10 -0500)]
cmd/compile: fix bug in logic for computing var abstract origins

The DWARF inline info generation code was using file/line/column (from
src.Pos) as a means of matching up pre- and post-optimization variable
nodes. This turns out to be problematic since it looks as though
distinct formals on the same line can be assigned the same column
number. Work around this issue by adding variable names to the
disambiguation code. Added a testpoint to the linker DWARF test that
checks to make sure each abstract origin offset of distinct within a
given DWARF DW_AT_inlined_routine body.

Fixes #23020.

Change-Id: Ie09bbe01dc60822d84d4085547b138e644036fb3
Reviewed-on: https://go-review.googlesource.com/82396
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
7 years agoapi: promote next to go1.10
Andrew Bonventre [Wed, 6 Dec 2017 21:47:52 +0000 (16:47 -0500)]
api: promote next to go1.10

Change-Id: I2a4347540ecb94a9f124a228dc31452620ab0645
Reviewed-on: https://go-review.googlesource.com/82335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agonet/http: use correct method name in Server.ServeTLS docs
Artyom Pervukhin [Thu, 7 Dec 2017 11:05:08 +0000 (14:05 +0300)]
net/http: use correct method name in Server.ServeTLS docs

Closes #23028

Change-Id: I469f1ab2dee9151334b38e0d3a22eb9840c8807b
Reviewed-on: https://go-review.googlesource.com/82495
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/dist: only test SWIG if we have a new enough version
Ian Lance Taylor [Thu, 7 Dec 2017 02:09:11 +0000 (18:09 -0800)]
cmd/dist: only test SWIG if we have a new enough version

Fixes #22858

Change-Id: I0478d5609e381f01c7345e7f53c24af05d7f78ad
Reviewed-on: https://go-review.googlesource.com/82415
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/vendor/golang.org/x/arch/arm64: update from upstream
Mikio Hara [Thu, 7 Dec 2017 04:29:26 +0000 (13:29 +0900)]
cmd/vendor/golang.org/x/arch/arm64: update from upstream

Updates x/arch/arm64 to git rev. 530ae47 for CL 82437.

Change-Id: I0131f7ac783462fcaeddf5625c59784fe30bbd5a
Reviewed-on: https://go-review.googlesource.com/82435
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agoencoding/xml: don't crash on invalid XMLName tag
Ian Lance Taylor [Thu, 7 Dec 2017 02:02:02 +0000 (18:02 -0800)]
encoding/xml: don't crash on invalid XMLName tag

Fixes #20953

Change-Id: Ia30a6e0e335c1f738e1359500e09057b5981f1c7
Reviewed-on: https://go-review.googlesource.com/82397
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc/go1.10: add NetBSD and OpenBSD to Go 1.10 release notes
Brad Fitzpatrick [Wed, 6 Dec 2017 18:44:13 +0000 (18:44 +0000)]
doc/go1.10: add NetBSD and OpenBSD to Go 1.10 release notes

Fixes #22911

Change-Id: I61de85323e290b64917a09bc512935e835ff7cf0
Reviewed-on: https://go-review.googlesource.com/82276
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agoruntime: sleep longer in dieFromSignal on Darwin
Ian Lance Taylor [Thu, 7 Dec 2017 00:24:10 +0000 (16:24 -0800)]
runtime: sleep longer in dieFromSignal on Darwin

Fixes #20315

Change-Id: I5d5c82f10902b59168fc0cca0af50286843df55d
Reviewed-on: https://go-review.googlesource.com/82375
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agoencoding/json: error when trying to set an embedded pointer to unexported struct...
Joe Tsai [Wed, 6 Dec 2017 06:38:36 +0000 (22:38 -0800)]
encoding/json: error when trying to set an embedded pointer to unexported struct types

This CL reverts CL 76851 and takes a different approach to #21357.
The changes in encode.go and encode_test.go are reverts that
rolls back the changed behavior in CL 76851 where
embedded pointers to unexported struct types were
unilaterally ignored in both marshal and unmarshal.

Instead, these fields are handled as before with the exception that
it returns an error when Unmarshal is unable to set an unexported field.
The behavior of Marshal is now unchanged with regards to #21357.

This policy maintains the greatest degree of backwards compatibility
and avoids silently discarding data the user may have expected to be present.

Fixes #21357

Change-Id: I7dc753280c99f786ac51acf7e6c0246618c8b2b1
Reviewed-on: https://go-review.googlesource.com/82135
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agolib/time: update tzdata to 2017c
Tobias Klauser [Sat, 28 Oct 2017 18:07:51 +0000 (20:07 +0200)]
lib/time: update tzdata to 2017c

Update the tzdata database to version 2017c (released 2017-10-20).

Updates #22487

Change-Id: If58ff89173ef1f1044075505f42ff132b57795f0
Reviewed-on: https://go-review.googlesource.com/74230
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agomisc/cgo/testplugin: unskip test
Russ Cox [Tue, 7 Nov 2017 14:56:11 +0000 (09:56 -0500)]
misc/cgo/testplugin: unskip test

Fixed by CL 76025 yesterday, without realizing it:
the testshared and testplugin builds of separate iface_i
packages were colliding incorrectly in the cache.
Including the build directory fixes that.

Fixes #22571.

Change-Id: Id8193781c67c3150823dc1f48eae781dfe3702fb
Reviewed-on: https://go-review.googlesource.com/76371
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
7 years agocmd/go: implement time-based trimming of build cache
Russ Cox [Tue, 5 Dec 2017 15:29:27 +0000 (10:29 -0500)]
cmd/go: implement time-based trimming of build cache

Fixes #22642.

Change-Id: I2ed6305555a0cf753b9cdce061463b1749d5e53e
Reviewed-on: https://go-review.googlesource.com/81975
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc/go1.10: preannounce removal of OS X 10.8 support in Go 1.11
Russ Cox [Wed, 6 Dec 2017 18:38:10 +0000 (13:38 -0500)]
doc/go1.10: preannounce removal of OS X 10.8 support in Go 1.11

For #23011.

Change-Id: Ibd934f32e41cb8dddbd3d68a324536cf29a97916
Reviewed-on: https://go-review.googlesource.com/82275
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: fix two spelling mistakes in contribute.html
Alberto Donizetti [Wed, 6 Dec 2017 09:59:40 +0000 (10:59 +0100)]
doc: fix two spelling mistakes in contribute.html

Change-Id: Ife60468d508f90321733ebdbdb0e6cf443ba1659
Reviewed-on: https://go-review.googlesource.com/82156
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc: fix dead link in go_faq
Alberto Donizetti [Wed, 6 Dec 2017 10:42:42 +0000 (11:42 +0100)]
doc: fix dead link in go_faq

Change-Id: I8a9e4d00247fe9bda6e19551850bdec0367df2e1
Reviewed-on: https://go-review.googlesource.com/82157
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodoc/go1.10: fix many TODOs
Russ Cox [Wed, 6 Dec 2017 05:01:26 +0000 (00:01 -0500)]
doc/go1.10: fix many TODOs

Change-Id: I97a28379b1a9ca3daa875edbcd5213673ca138d0
Reviewed-on: https://go-review.googlesource.com/82115
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agodoc/go1.10: process comments from CL 78131 PS 5
Russ Cox [Wed, 6 Dec 2017 04:36:53 +0000 (23:36 -0500)]
doc/go1.10: process comments from CL 78131 PS 5

Change-Id: Ie246756452cd872961aeb659b35297c229504a3c
Reviewed-on: https://go-review.googlesource.com/81936
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agodoc/go1.10: update release notes for recent commits
Russ Cox [Wed, 6 Dec 2017 03:20:46 +0000 (22:20 -0500)]
doc/go1.10: update release notes for recent commits

Change-Id: Id6ced9a6c76131263041cdaf5ed17479be075fa6
Reviewed-on: https://go-review.googlesource.com/82075
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agodoc: fix spelling in editor guide
Tobias Klauser [Wed, 6 Dec 2017 15:15:08 +0000 (16:15 +0100)]
doc: fix spelling in editor guide

Change-Id: If16f069f410d043fd11864a4c1a7d54b5b4922d2
Reviewed-on: https://go-review.googlesource.com/82200
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agohash: add MarshalBinary/UnmarshalBinary round trip + golden test for all implementations
Russ Cox [Wed, 6 Dec 2017 07:17:24 +0000 (02:17 -0500)]
hash: add MarshalBinary/UnmarshalBinary round trip + golden test for all implementations

There are some basic tests in the packages implementing the hashes,
but this one is meant to be comprehensive for the standard library
as a whole.

Most importantly, it locks in the current representations and makes
sure that they do not change from release to release (and also, as a
result, that future releases can parse the representations generated
by older releases).

The crypto/* MarshalBinary implementations are being changed
in this CL to write only d.x[:d.nx] to the encoding, with zeros for
the remainder of the slice d.x[d.nx:]. The old encoding wrote the
whole d.x, but that exposed an internal detail: whether d.x is
cleared after a full buffer is accumulated, and also whether d.x was
used at all for previous blocks (consider 1-byte writes vs 1024-byte writes).
The new encoding writes only what the decoder needs to know,
nothing more.

In fact the old encodings were arguably also a security hole,
because they exposed data written even before the most recent
call to the Reset method, data that clearly has no impact on the
current hash and clearly should not be exposed. The leakage
is clearly visible in the old crypto/sha1 golden test tables also
being modified in this CL.

Change-Id: I4e9193a3ec5f91d27ce7d0aa24c19b3923741416
Reviewed-on: https://go-review.googlesource.com/82136
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
7 years agocrypto/x509/pkix: remove references to fmt.Stringer in String method docs
Russ Cox [Wed, 6 Dec 2017 02:53:30 +0000 (21:53 -0500)]
crypto/x509/pkix: remove references to fmt.Stringer in String method docs

String method comments should explain what they do,
not that they are attempting to implement fmt.Stringer.

Change-Id: If51dd1ff2f0c2f9ef9dca569bfa0c3914be2e8fe
Reviewed-on: https://go-review.googlesource.com/82081
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodatabase/sql/driver: explain Driver vs DriverContext vs Connector
Russ Cox [Wed, 6 Dec 2017 03:12:52 +0000 (22:12 -0500)]
database/sql/driver: explain Driver vs DriverContext vs Connector

The docs make it seem like they are all things a single object
would implement. That's true of Driver and DriverContext,
but Connector is really something else. Attempt to clarify.

Change-Id: I8fdf1cff855a0fbe37ea22720c082045c719a267
Reviewed-on: https://go-review.googlesource.com/82082
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
7 years agoflag: clarify comment to avoid shell syntax confusion
Ian Lance Taylor [Tue, 5 Dec 2017 21:24:45 +0000 (13:24 -0800)]
flag: clarify comment to avoid shell syntax confusion

Updates #22961

Change-Id: Ib2f41aefb4f6470598d8637611da5491156ea840
Reviewed-on: https://go-review.googlesource.com/82015
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocrypto/x509: add test for asn1.Marshal of rsa.PublicKey
Russ Cox [Wed, 6 Dec 2017 02:26:07 +0000 (21:26 -0500)]
crypto/x509: add test for asn1.Marshal of rsa.PublicKey

Go 1.10 is adding new API MarshalPKCS1PublicKey and
ParsePKCS1PublicKey for converting rsa.PublicKeys.

Even though we'd prefer that users did not, check that
if users call asn1.Marshal and asn1.Unmarshal directly instead,
they get the same results. We know that code exists in the
wild that depends on this.

Change-Id: Ia385d6954fda2eba7da228dc42f229b6839ef11e
Reviewed-on: https://go-review.googlesource.com/82080
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>