1
0
mirror of https://github.com/golang/go synced 2024-10-06 00:21:21 -06:00
Commit Graph

24544 Commits

Author SHA1 Message Date
Didier Spezia
1a99ba55df encoding/json: fix decoding of JSON null values
JSON decoding currently fails for null values bound to any type
which does implement the JSON Unmarshaler interface without checking
for null values (such as time.Time).

It also fails for types implementing the TextUnmarshaler interface.

The expected behavior of the JSON decoding engine in such case is
to process null by keeping the value unchanged without producing
any error.

Make sure null values are handled by the decoding engine itself,
and never passed to the UnmarshalText or UnmarshalJSON methods.

Fixes #9037

Change-Id: I261d85587ba543ef6f1815555b2af9311034d5bb
Reviewed-on: https://go-review.googlesource.com/9376
Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-22 15:39:54 +00:00
Andrew Gerrand
1421bc10a4 misc/makerelease: delete
This is now superseded by golang.org/x/build/cmd/release.

Fixes #8472

Change-Id: I59664d84996a0fbb5c90582a4702714b3b3cf302
Reviewed-on: https://go-review.googlesource.com/12500
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-22 09:18:33 +00:00
David Symonds
23f4e43564 lib/time: update to IANA release 2015e.
Fixes #11810.

Change-Id: I8453e53a72e242a69ea34eb393999e7291d4358f
Reviewed-on: https://go-review.googlesource.com/12502
Run-TryBot: David Symonds <dsymonds@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-07-22 02:56:31 +00:00
Rob Pike
6c7acdfbdb doc: add a clause about embedded methods to go1compat
This is a corner case but it is suggested we call it out.

Fixes #11798.

Change-Id: I2ddb5b363cd2921666dbf03bbf98107697ca40e5
Reviewed-on: https://go-review.googlesource.com/12460
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-22 01:25:32 +00:00
Brad Fitzpatrick
fc7f6d307a cmd/dist: remove prints during test registration
dist test should not print (especially to stdout) during test
registration.  This confuses other tools interacting with dist using
dist test --list, etc.

Change-Id: Ie4f82c13e49590c23a7a235d90ddbc4f5ed81e0b
Reviewed-on: https://go-review.googlesource.com/12487
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-21 22:40:01 +00:00
Ian Lance Taylor
c97b49976d cmd/go: fix typo in comment
Change-Id: I3d5e46d376953fbdd21ce8c161214eaed6378d84
Reviewed-on: https://go-review.googlesource.com/12490
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-21 22:25:11 +00:00
Ian Lance Taylor
419a6c0709 cmd/go: pass an unmodified environment to a go run program
Fixes #11709.
Fixed #11449.

Change-Id: If8fdb27d3dc25fb7017226d143a29cbebc1374c5
Reviewed-on: https://go-review.googlesource.com/12483
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-21 22:19:00 +00:00
Robert Griesemer
0505dfc637 go/types: make types.Typ a slice, unexport UniverseByte/Rune
In lieu of the more invasive https://go-review.googlesource.com/#/c/12373/ .

Change-Id: I0221783fcaa8af04520c80cd2993d7d542d2c431
Reviewed-on: https://go-review.googlesource.com/12486
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-21 20:28:23 +00:00
Ian Lance Taylor
72921c663d cmd/go: skip TestGoInstallErrorOnCrossCompileToBin in short mode
That test will install cmd/pack for linux_386; we don't want to change
GOROOT in short mode.

Change-Id: I4b00c578a99779a13c558208bfd4115f8f0513fa
Reviewed-on: https://go-review.googlesource.com/12481
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-21 19:31:54 +00:00
Ingo Krabbe
2e38b3511a misc/cgo/testsovar: needs the extern keyword to export variables on non-windows platforms
Change-Id: I87fa25214fbf24469148a63f4e1e61e261105c16
Reviewed-on: https://go-review.googlesource.com/12470
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-21 18:10:57 +00:00
Josh Bleecher Snyder
8fb6358153 [dev.ssa] cmd/compile: don't generate zero values for ssa ops
Shorter code, easier to read, no pointless empty slices.

Change-Id: Id410364b4f6924b5665188af3373a5e914117c38
Reviewed-on: https://go-review.googlesource.com/12480
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 16:03:54 +00:00
Josh Bleecher Snyder
ac1935b3a7 [dev.ssa] cmd/compile: fix build
Bad rebase in CL 12439.

Change-Id: I7ad359519c6274be37456b655f19bf0ca6ac6692
Reviewed-on: https://go-review.googlesource.com/12449
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-21 14:02:34 +00:00
Josh Bleecher Snyder
a402b58e51 [dev.ssa] cmd/compile: implement "if SETEQ" branches
Change-Id: I814fd0c2f1a622cca7dfd1b771f81de309a1904c
Reviewed-on: https://go-review.googlesource.com/12441
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 13:50:14 +00:00
Josh Bleecher Snyder
2574e4ac1c [dev.ssa] cmd/compile: call through to expr for expression statements
Change-Id: I8625eff33f5a49dbaaec060c3fa067d7531193c4
Reviewed-on: https://go-review.googlesource.com/12313
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 13:49:48 +00:00
Josh Bleecher Snyder
67bfd69564 [dev.ssa] cmd/compile: fix stackalloc handling of zero-aligned variables
Prior to this fix, a zero-aligned variable such as a flags
variable would reset n to 0.

While we're here, log the stack layout so that debugging
and reading the generated assembly is easier.

Change-Id: I18ef83ea95b6ea877c83f2e595e14c48c9ad7d84
Reviewed-on: https://go-review.googlesource.com/12439
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 13:49:10 +00:00
Josh Bleecher Snyder
26f135d7c1 [dev.ssa] cmd/compile: mark LoadReg8 and StoreReg8 of flags as unimplemented
It is not clear to me what the right implementation is.
LoadReg8 and StoreReg8 are introduced during regalloc,
so after the amd64 rewrites. But implementing them
in genValue seems silly.

Change-Id: Ia708209c4604867bddcc0e5d75ecd17cf32f52c3
Reviewed-on: https://go-review.googlesource.com/12437
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 13:41:39 +00:00
Josh Bleecher Snyder
a794074da0 [dev.ssa] cmd/compile: implement genValue for AMD64SETxx
Change-Id: I591f2c0465263dcdeef46920aabf1bbb8e7ac5c0
Reviewed-on: https://go-review.googlesource.com/12436
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 13:40:52 +00:00
Josh Bleecher Snyder
983bc8d1a2 Revert "[dev.ssa] cmd/compile: don't Compile if Unimplemented"
This reverts commit 766bcc92a5.

Change-Id: I55413c1aa80d82c856a3ea89b4ffccf80fb58013
Reviewed-on: https://go-review.googlesource.com/12361
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-21 13:38:53 +00:00
Keith Randall
67fdb0de86 [dev.ssa] cmd/compile/internal/ssa: use width and sign specific opcodes
Bake the bit width and signedness into opcodes.
Pro: Rewrite rules become easier.  Less chance for confusion.
Con: Lots more opcodes.

Let me know what you think.  I'm leaning towards this, but I could be
convinced otherwise if people think this is too ugly.

Update #11467

Change-Id: Icf1b894268cdf73515877bb123839800d97b9df9
Reviewed-on: https://go-review.googlesource.com/12362
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-07-21 04:34:02 +00:00
Ian Lance Taylor
e9fcd6ed2b cmd/link: if -B option was used, pass it to the external linker
Fixes #10607.

Change-Id: Ib294cf65b07103b60f62b86b21ff2d07b25136fe
Reviewed-on: https://go-review.googlesource.com/12242
Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-21 03:57:55 +00:00
Brad Fitzpatrick
aee4f42a2b doc: add missing preposition in go1.5.html
Change-Id: I2f855b9ad1676b3c4efedd764ce99e21c104a4ec
Reviewed-on: https://go-review.googlesource.com/12446
Reviewed-by: Rob Pike <r@golang.org>
2015-07-21 03:29:22 +00:00
Paul Marks
abf943aa37 doc/go1.5.html: update the net.Dial release notes.
Change-Id: Ie02426b2b726170d858de96fdd8c51bfdf20d7dc
Reviewed-on: https://go-review.googlesource.com/12376
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-21 03:23:14 +00:00
Brad Fitzpatrick
852f383c9b api: add go1.5.txt API file, reset next.txt
Fixes #11752

Change-Id: If4196b4bbba4f1485608bfafa98fa54781177273
Reviewed-on: https://go-review.googlesource.com/12325
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-21 02:48:35 +00:00
Brad Fitzpatrick
aa5118b129 doc: remove mention of default GOMAXPROCS(1) in Effective Go
Fixes #11781

Change-Id: Idc46a6a4fb5bf1c4d394eadf2d860d7ef75c8ccf
Reviewed-on: https://go-review.googlesource.com/12390
Reviewed-by: Rob Pike <r@golang.org>
2015-07-21 02:45:44 +00:00
Alex Brainman
7ebcf5eac7 syscall: warn not to use FormatMessage
Fixes #11147

Change-Id: Ib31160946a53f6f9b11daea211ff04d186b51b3f
Reviewed-on: https://go-review.googlesource.com/12067
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-21 02:26:27 +00:00
Matthew Dempsky
af8297da86 go/internal/gccgoimporter: fix handling of "byte" and "rune" alias types
Fixes #11762.

Change-Id: I0c7797a2dfdbbcf137bb287f854037a4a697c6e4
Reviewed-on: https://go-review.googlesource.com/12443
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2015-07-21 02:04:05 +00:00
Josh Bleecher Snyder
8043f450c1 [dev.ssa] cmd/compile: fix test verb
The verb doesn't do anything, but if/when we move
these to the test directory, having it be right
will be one fewer thing to remember.

Change-Id: Ibf0280d7cc14bf48927e25215de6b91c111983d9
Reviewed-on: https://go-review.googlesource.com/12438
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-21 00:09:24 +00:00
Josh Bleecher Snyder
21bd483c4a [dev.ssa] cmd/compile: refactor out zero value creation
This will be used in a subsequent commit.

Change-Id: I43eca21f4692d99e164c9f6be0760597c46e6a26
Reviewed-on: https://go-review.googlesource.com/12440
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-21 00:08:59 +00:00
Brad Fitzpatrick
e28ff1f3a1 doc: document net/http.Request.Cancel in go1.5.html
Change-Id: If1c12b43ef467c3ef2cbbaaba1bda4ea98032c7e
Reviewed-on: https://go-review.googlesource.com/12430
Reviewed-by: Rob Pike <r@golang.org>
2015-07-20 23:36:13 +00:00
Brad Fitzpatrick
1b5eaa4382 doc: add crypto/sha512 additions to go1.5.html
Change-Id: I805bb7ba40c8ed579c4ca796e408995586d219b3
Reviewed-on: https://go-review.googlesource.com/12434
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-07-20 23:35:38 +00:00
Robert Griesemer
3051ab2ce7 go/types: remove non-existing mention of MethodSetCache from comment
Fixes #11800.

Change-Id: I5eb178331f4ae80821f188e19c0c6fadeb330278
Reviewed-on: https://go-review.googlesource.com/12433
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-07-20 21:55:20 +00:00
Josh Bleecher Snyder
ffbf209a7c [dev.ssa] test: gofmt {goto,label,label1}.go
Change-Id: I971d0c93632e39aad4e2ba1862f085df820baf8b
Reviewed-on: https://go-review.googlesource.com/12431
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-20 20:09:34 +00:00
Ian Lance Taylor
1a0818a40d cmd/dist: increase timeout for standard tests
The cmd/go tests run too long on a Raspberry Pi.  I've cut times as
much as I can see without more serious steps like not running tests.

Fixes #11779.

Change-Id: Ice5da052902decea2e6ac32d0f2ce084c39ea1ab
Reviewed-on: https://go-review.googlesource.com/12368
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-20 18:05:59 +00:00
Josh Bleecher Snyder
f421735bb4 [dev.ssa] cmd/compile: handle OpCopy loops in rewrite
Change-Id: Icbaad6e5cbfc5430a651538fe90c0a9ee664faf4
Reviewed-on: https://go-review.googlesource.com/12360
Reviewed-by: Keith Randall <khr@golang.org>
2015-07-20 17:35:08 +00:00
Ian Lance Taylor
510f1dbad7 cmd/go: build errors rather than fmt in a couple of tests
The errors package is smaller and builds faster.

Update #11779.

Change-Id: Iaf2d43734ec4b0aa325590eb5d38522306b608cb
Reviewed-on: https://go-review.googlesource.com/12366
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-20 16:31:37 +00:00
Ian Lance Taylor
b9a3e5979d cmd/go: build errors rather than strings in some tests
Speed up the test suite by building the errors package rather than the
strings package in some cases where the specific package we are
building doesn't matter.  The errors package is smaller, and doesn't
have any assembler code.

Also make a couple of tests run in parallel.

Update #11779.

Change-Id: I62e47f8655f9d85bf93c70ae6e6121276d96aee0
Reviewed-on: https://go-review.googlesource.com/12365
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-20 15:57:05 +00:00
Ian Lance Taylor
f35868a49a cmd/go: don't run TestInstalls in short mode
It changes GOROOT, so we shouldn't run it in short mode.  Also, it's
fairly slow.

Update #11779.

Change-Id: I3d3344954cf9b2ac70070c878a67cb65ac8fd85c
Reviewed-on: https://go-review.googlesource.com/12364
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-20 03:27:22 +00:00
Ian Lance Taylor
f7e7719f65 cmd/go: rewrite TestNoteReading to use test harness
On my laptop reduces time required for test from 22 seconds to 0.14
seconds.

Update #11779.

Change-Id: I715d85bd9c6f7683c6915eedd2539813aa5efc58
Reviewed-on: https://go-review.googlesource.com/12363
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-20 03:25:18 +00:00
Michael Hudson-Doyle
1125cd4997 cmd/compile: define func value symbols at declaration
This is mostly Russ's https://golang.org/cl/12145 but with some extra fixes to
account for the fact that function declarations without implementations now
break shared libraries, and including my test case.

Fixes #11480.

Change-Id: Iabdc2934a0378e5025e4e7affadb535eaef2c8f1
Reviewed-on: https://go-review.googlesource.com/12340
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-20 00:50:46 +00:00
Brad Fitzpatrick
4db074639c net/http: add example for setting trailers in an Handler
Change-Id: I6a8bb853a538c80d95589321d3226784bc017eef
Reviewed-on: https://go-review.googlesource.com/12327
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-20 00:40:40 +00:00
Austin Clements
1942e3814b runtime: clarify runtime.GC blocking behavior
The runtime.GC documentation was rewritten in df2809f to make it clear
that it blocks until GC is complete, but the re-rewrite in ed9a4c9 and
e28a679 lost this property when clarifying that it may also block the
entire program and not just the caller.

Try to arrive at wording that conveys both of these properties.

Change-Id: I1e255322aa28a21a548556ecf2a44d8d8ac524ef
Reviewed-on: https://go-review.googlesource.com/12392
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-07-19 15:10:06 +00:00
Ian Lance Taylor
692054e76e runtime: check for findmoduledatap returning nil
The findmoduledatap function will not return nil in ordinary use, but
check for nil to try to avoid crashing when we are already crashing.

Update #11783.

Change-Id: If7b1adb51efab13b4c1a37b6f3c9ad22641a0b56
Reviewed-on: https://go-review.googlesource.com/12391
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-18 21:26:59 +00:00
Dmitry Vyukov
e1ee31400a internal/trace: fix fuzzer crashers
Fixes #11766
Fixes #11769
Fixes #11767
Fixes #11770

Change-Id: I441382af58f60deb46dcdd70076763b2c47738d4
Reviewed-on: https://go-review.googlesource.com/12378
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-18 19:51:50 +00:00
Silvan Jegen
c4bfd2de20 bufio: Remove unneeded error initialization
The default value for error is nil so there is no need to assign this
value here.

Change-Id: I4714ef7607996ccbf91b704390e1d1d39ee3847b
Reviewed-on: https://go-review.googlesource.com/12355
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-18 18:05:23 +00:00
Ian Lance Taylor
dabb268170 cmd/compile: ignore carriage return in magic comments
Update #11771.

Change-Id: I3bb3262619765d3ca79652817e17e8f260f41907
Reviewed-on: https://go-review.googlesource.com/12379
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-18 17:33:53 +00:00
Mikio Hara
aadd84e0c4 net: classify site-local unicast in address selection
This change adds site-local unicast classification for users still using
the deprecated addresses internally.

Change-Id: If50870c6d4a85fe471c002b161eec59efcebe2f4
Reviewed-on: https://go-review.googlesource.com/12344
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-18 01:35:25 +00:00
Brad Fitzpatrick
90c668d1af os: remove stuttering return value names
Old style. Make it compliant with our code review comments document.

Also, make WriteString's return parameter named 'n', not 'ret', for
consistency.

Noticed during another documentation review.

Change-Id: Ie88910c5841f8353bc5c0152e2168b497578e15e
Reviewed-on: https://go-review.googlesource.com/12324
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-18 01:34:21 +00:00
Alex Brainman
4a0d9587f2 runtime: skip TestReturnAfterStackGrowInCallback if gcc is not found
Fixes #11754

Change-Id: Ifa423ca6eea46d1500278db290498724a9559d14
Reviewed-on: https://go-review.googlesource.com/12347
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-18 01:29:09 +00:00
Brad Fitzpatrick
60315002f3 doc: document GODEBUG=netdns=X and netcgo in go1.5.txt
Change-Id: I720aeb1511e407750617e23c4cba1edcddf745bb
Reviewed-on: https://go-review.googlesource.com/12326
Reviewed-by: Rob Pike <r@golang.org>
2015-07-18 01:00:55 +00:00
Rob Pike
e28a679216 runtime: make the GC message less committal.
We shouldn't guarantee this behavior, but suggest it's possible.

Change-Id: I4c2afb48b99be4d91537306d3337171a13c9990a
Reviewed-on: https://go-review.googlesource.com/12346
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-18 00:28:50 +00:00