Compare commits

..

13 Commits

Author SHA1 Message Date
Rick Hudson
1d4942afe0 [dev.garbage] runtime: determine if an object is public
ROC (request oriented collector) needs to determine
if an object is visible to other goroutines, i.e.
public. In a later CL this will be used by the write
barrier and the publishing logic to distinguish between
local and public objects and act accordingly.

Change-Id: I6a80da9deb21f57e831a2ec04e41477f997a8c33
Reviewed-on: https://go-review.googlesource.com/25056
Reviewed-by: Austin Clements <austin@google.com>
2017-05-25 18:05:53 +00:00
Austin Clements
8b25a00e6d Merge branch 'master' into dev.garbage
Change-Id: I36274cf72b8e1908efc8e375cab7880d7b0b3f43
2017-01-11 11:34:07 -05:00
Austin Clements
42afbd9e63 Merge branch 'master' into dev.garbage
Sync to 1.8 beta 1.

Change-Id: Iddd3773babd8fe50aed791ef7150d0c7c455cc8d
2016-12-05 12:15:50 -05:00
Austin Clements
f9f6c90ed1 [dev.garbage] Merge branch 'master' into dev.garbage
This merges master as of the Go 1.7 release.

Change-Id: I95ac0f96a0837173a2b8d7e8aaadf6fecc1baeaf
2016-08-25 11:55:08 -04:00
Rick Hudson
69161e279e [dev.garbage] runtime: Add GODEBUG=gcroc=n
Add command line boilerplace that turns the ROC algorithm on.
gcroc=0 or not specified:
	does not turn ROC on but some benign code may run.
gcroc=1
	simply turns the algorithm on
gcroc>1
	same as gcroc but with increasing levels of diagnostics
	being turned on. Expect gcroc>1 to not be as performant as
	gcroc=1

Change-Id: I6348b6768f7a3f8c2f69ef01ea20efebf992029e
Reviewed-on: https://go-review.googlesource.com/21368
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-26 13:21:53 +00:00
Austin Clements
fb4c718209 [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I8ba4b012d82921f9521f471b1c0b5a1f6149a986
2016-07-19 17:54:41 -04:00
Austin Clements
81b74bf9c5 [dev.garbage] runtime: make _TinySizeClass an int8 to prevent use as spanClass
Currently _TinySizeClass is untyped, which means it can accidentally
be used as a spanClass (not that I would know this from experience or
anything). Make it an int8 to avoid this mix up.

Change-Id: I1e69eccee436ea5aa45e9a9828a013e369e03f1a
Reviewed-on: https://go-review.googlesource.com/24372
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-23 16:26:08 +00:00
Austin Clements
edb54c300f [dev.garbage] runtime: eliminate heapBitsSetTypeNoScan
It's no longer necessary to maintain the bitmap of noscan objects
since we now use the span metadata to determine that they're noscan
instead of the bitmap.

The combined effect of segregating noscan spans and the follow-on
optimizations is almost no effect on the go1 benchmarks and a 1.19%
improvement in the garbage benchmark:

name              old time/op  new time/op  delta
XBenchGarbage-12  2.13ms ± 2%  2.11ms ± 1%  -1.19%  (p=0.000 n=19+20)

name                      old time/op    new time/op    delta
BinaryTree17-12              2.42s ± 1%     2.41s ± 1%  -0.50%  (p=0.001 n=20+17)
Fannkuch11-12                2.14s ± 0%     2.12s ± 0%  -0.91%  (p=0.000 n=20+17)
FmtFprintfEmpty-12          45.2ns ± 0%    45.2ns ± 1%    ~     (p=0.677 n=16+19)
FmtFprintfString-12          131ns ± 0%     132ns ± 1%  +0.57%  (p=0.000 n=16+20)
FmtFprintfInt-12             126ns ± 1%     126ns ± 0%    ~     (p=0.078 n=18+16)
FmtFprintfIntInt-12          199ns ± 0%     195ns ± 0%  -2.19%  (p=0.000 n=14+20)
FmtFprintfPrefixedInt-12     196ns ± 1%     196ns ± 0%    ~     (p=0.155 n=19+16)
FmtFprintfFloat-12           254ns ± 0%     253ns ± 0%  -0.50%  (p=0.000 n=14+19)
FmtManyArgs-12               803ns ± 1%     798ns ± 0%  -0.71%  (p=0.000 n=18+19)
GobDecode-12                7.11ms ± 1%    7.07ms ± 1%  -0.50%  (p=0.024 n=18+19)
GobEncode-12                5.87ms ± 0%    5.86ms ± 1%    ~     (p=0.113 n=19+20)
Gzip-12                      218ms ± 1%     218ms ± 1%    ~     (p=0.879 n=19+20)
Gunzip-12                   37.2ms ± 0%    37.3ms ± 0%  +0.14%  (p=0.047 n=19+20)
HTTPClientServer-12         80.5µs ± 6%    82.8µs ± 8%  +2.91%  (p=0.008 n=19+20)
JSONEncode-12               15.4ms ± 1%    15.4ms ± 1%  -0.32%  (p=0.003 n=18+19)
JSONDecode-12               55.1ms ± 1%    53.0ms ± 1%  -3.87%  (p=0.000 n=18+20)
Mandelbrot200-12            4.08ms ± 1%    4.10ms ± 1%  +0.34%  (p=0.001 n=19+17)
GoParse-12                  3.20ms ± 1%    3.21ms ± 1%    ~     (p=0.138 n=19+19)
RegexpMatchEasy0_32-12      70.6ns ± 2%    70.4ns ± 2%    ~     (p=0.343 n=20+20)
RegexpMatchEasy0_1K-12       240ns ± 0%     242ns ± 2%  +0.88%  (p=0.000 n=15+20)
RegexpMatchEasy1_32-12      70.5ns ± 1%    70.2ns ± 3%    ~     (p=0.053 n=18+20)
RegexpMatchEasy1_1K-12       374ns ± 1%     374ns ± 1%    ~     (p=0.705 n=20+19)
RegexpMatchMedium_32-12      108ns ± 1%     108ns ± 1%    ~     (p=0.854 n=20+19)
RegexpMatchMedium_1K-12     33.5µs ± 1%    33.6µs ± 2%    ~     (p=0.897 n=18+20)
RegexpMatchHard_32-12       1.76µs ± 1%    1.75µs ± 1%    ~     (p=0.771 n=18+18)
RegexpMatchHard_1K-12       52.8µs ± 1%    52.8µs ± 1%    ~     (p=0.678 n=17+19)
Revcomp-12                   381ms ± 1%     380ms ± 0%    ~     (p=0.320 n=20+16)
Template-12                 65.6ms ± 1%    65.1ms ± 2%  -0.75%  (p=0.003 n=20+20)
TimeParse-12                 324ns ± 1%     326ns ± 1%  +0.72%  (p=0.000 n=18+18)
TimeFormat-12                342ns ± 0%     343ns ± 1%  +0.22%  (p=0.004 n=15+18)
[Geo mean]                  52.4µs         52.3µs       -0.18%

Change-Id: Ic77faaa15cdac3bfbbb0032dde5c204e05a0fd8e
Reviewed-on: https://go-review.googlesource.com/23702
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-15 21:17:15 +00:00
Austin Clements
312aa09996 [dev.garbage] runtime: eliminate heapBits.hasPointers
This is no longer necessary now that we can more efficiently consult
the span's noscan bit.

Change-Id: Id0b00b278533660973f45eb6efa5b00f373d58af
Reviewed-on: https://go-review.googlesource.com/23701
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-15 21:17:04 +00:00
Austin Clements
d491e550c3 [dev.garbage] runtime: separate spans of noscan objects
Currently, we mix objects with pointers and objects without pointers
("noscan" objects) together in memory. As a result, for every object
we grey, we have to check that object's heap bits to find out if it's
noscan, which adds to the per-object cost of GC. This also hurts the
TLB footprint of the garbage collector because it decreases the
density of scannable objects at the page level.

This commit improves the situation by using separate spans for noscan
objects. This will allow a much simpler noscan check (in a follow up
CL), eliminate the need to clear the bitmap of noscan objects (in a
follow up CL), and improves TLB footprint by increasing the density of
scannable objects.

This is also a step toward eliminating dead bits, since the current
noscan check depends on checking the dead bit of the first word.

This has no effect on the heap size of the garbage benchmark.

We'll measure the performance change of this after the follow-up
optimizations.

Change-Id: I13bdc4869538ece5649a8d2a41c6605371618e40
Reviewed-on: https://go-review.googlesource.com/23700
Reviewed-by: Rick Hudson <rlh@golang.org>
2016-06-15 21:16:53 +00:00
Austin Clements
641c32dafa [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I7ab2afca656e8c145804d9823cd084b8a85bccd7
2016-06-06 10:01:41 -04:00
Austin Clements
2e495a1df6 [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I35edefb4464566601850081ecc84dd3535d60ceb
2016-05-16 14:29:53 -04:00
Austin Clements
344476d23c [dev.garbage] Merge branch 'master' into dev.garbage
Change-Id: I2e04fd9e7071efe33ce76f2f10a8dbde53ba90b9
2016-05-09 14:49:54 -04:00
2170 changed files with 93211 additions and 255252 deletions

View File

@@ -7,7 +7,6 @@ Please answer these questions before submitting your issue. Thanks!
### What did you do? ### What did you do?
If possible, provide a recipe for reproducing the error. If possible, provide a recipe for reproducing the error.
A complete runnable program is good. A complete runnable program is good.
A link on play.golang.org is best. A link on play.golang.org is best.

14
.github/SUPPORT vendored
View File

@@ -1,14 +0,0 @@
Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions.
We only use our bug tracker for tracking bugs and tracking proposals going through the [Proposal Process](https://golang.org/s/proposal-process).
For asking questions, see:
* [The golang-nuts mailing list](https://groups.google.com/d/forum/golang-nuts)
* [The Go Forum](https://forum.golangbridge.org/), a web-based forum
* [Gophers Slack](https://gophers.slack.com), use the [invite app](https://invite.slack.golangbridge.org/) for access
* [Stack Overflow](http://stackoverflow.com/questions/tagged/go) with questions tagged "go"
* **IRC** channel #go-nuts on Freenode

6
.gitignore vendored
View File

@@ -31,9 +31,9 @@ _testmain.go
/pkg/ /pkg/
/src/*.*/ /src/*.*/
/src/cmd/cgo/zdefaultcc.go /src/cmd/cgo/zdefaultcc.go
/src/cmd/go/internal/cfg/zdefaultcc.go /src/cmd/go/zdefaultcc.go
/src/cmd/go/internal/cfg/zosarch.go /src/cmd/go/zosarch.go
/src/cmd/internal/objabi/zbootstrap.go /src/cmd/internal/obj/zbootstrap.go
/src/go/build/zcgo.go /src/go/build/zcgo.go
/src/go/doc/headscan /src/go/doc/headscan
/src/runtime/internal/sys/zversion.go /src/runtime/internal/sys/zversion.go

221
AUTHORS
View File

@@ -16,20 +16,14 @@ Aaron France <aaron.l.france@gmail.com>
Aaron Torres <tcboox@gmail.com> Aaron Torres <tcboox@gmail.com>
Abe Haskins <abeisgreat@abeisgreat.com> Abe Haskins <abeisgreat@abeisgreat.com>
Abhinav Gupta <abhinav.g90@gmail.com> Abhinav Gupta <abhinav.g90@gmail.com>
Adam Eijdenberg <adam@continusec.com>
Adam Kisala <adam.kisala@gmail.com>
Aditya Mukerjee <dev@chimeracoder.net>
Adrian Nos <nos.adrian@gmail.com> Adrian Nos <nos.adrian@gmail.com>
Adrian O'Grady <elpollouk@gmail.com> Adrian O'Grady <elpollouk@gmail.com>
Adrien Bustany <adrien-xx-google@bustany.org> Adrien Bustany <adrien-xx-google@bustany.org>
Aécio Júnior <aeciodantasjunior@gmail.com> Aécio Júnior <aeciodantasjunior@gmail.com>
Agis Anastasopoulos <agis.anast@gmail.com>
Ahmed Waheed Moanes <oneofone@gmail.com> Ahmed Waheed Moanes <oneofone@gmail.com>
Ahmy Yulrizka <yulrizka@gmail.com> Ahmy Yulrizka <yulrizka@gmail.com>
Aiden Scandella <ai@uber.com> Aiden Scandella <ai@uber.com>
Ainar Garipov <gugl.zadolbal@gmail.com> Ainar Garipov <gugl.zadolbal@gmail.com>
Aishraj Dahal <aishraj@users.noreply.github.com>
Akhil Indurti <contact@akhilindurti.com>
Akihiro Suda <suda.kyoto@gmail.com> Akihiro Suda <suda.kyoto@gmail.com>
Akshat Kumar <seed@mail.nanosouffle.net> Akshat Kumar <seed@mail.nanosouffle.net>
Alan Shreve <alan@inconshreveable.com> Alan Shreve <alan@inconshreveable.com>
@@ -52,9 +46,6 @@ Alex Schroeder <alex@gnu.org>
Alex Sergeyev <abc@alexsergeyev.com> Alex Sergeyev <abc@alexsergeyev.com>
Alexander Demakin <alexander.demakin@gmail.com> Alexander Demakin <alexander.demakin@gmail.com>
Alexander Döring <email@alexd.ch> Alexander Döring <email@alexd.ch>
Alexander Guz <kalimatas@gmail.com>
Alexander Kauer <alexander@affine.space>
Alexander Kucherenko <alxkchr@gmail.com>
Alexander Larsson <alexander.larsson@gmail.com> Alexander Larsson <alexander.larsson@gmail.com>
Alexander Menzhinsky <amenzhinsky@gmail.com> Alexander Menzhinsky <amenzhinsky@gmail.com>
Alexander Morozov <lk4d4math@gmail.com> Alexander Morozov <lk4d4math@gmail.com>
@@ -69,9 +60,7 @@ Alexandre Fiori <fiorix@gmail.com>
Alexandre Normand <alexandre.normand@gmail.com> Alexandre Normand <alexandre.normand@gmail.com>
Alexei Sholik <alcosholik@gmail.com> Alexei Sholik <alcosholik@gmail.com>
Alexey Borzenkov <snaury@gmail.com> Alexey Borzenkov <snaury@gmail.com>
Alexey Neganov <neganovalexey@gmail.com>
Alexey Palazhchenko <alexey.palazhchenko@gmail.com> Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
Alexis Hildebrandt <surryhill@gmail.com>
Aliaksandr Valialkin <valyala@gmail.com> Aliaksandr Valialkin <valyala@gmail.com>
Alif Rachmawadi <subosito@gmail.com> Alif Rachmawadi <subosito@gmail.com>
Allan Simon <allan.simon@supinfo.com> Allan Simon <allan.simon@supinfo.com>
@@ -79,8 +68,6 @@ Alok Menghrajani <alok.menghrajani@gmail.com>
Amazon.com, Inc Amazon.com, Inc
Amir Mohammad Saied <amir@gluegadget.com> Amir Mohammad Saied <amir@gluegadget.com>
Amrut Joshi <amrut.joshi@gmail.com> Amrut Joshi <amrut.joshi@gmail.com>
Anders Pearson <anders@columbia.edu>
André Carvalho <asantostc@gmail.com>
Andre Nathan <andrenth@gmail.com> Andre Nathan <andrenth@gmail.com>
Andreas Auernhammer <aead@mail.de> Andreas Auernhammer <aead@mail.de>
Andreas Litt <andreas.litt@gmail.com> Andreas Litt <andreas.litt@gmail.com>
@@ -88,7 +75,6 @@ Andrei Korzhevskii <a.korzhevskiy@gmail.com>
Andrei Vieru <euvieru@gmail.com> Andrei Vieru <euvieru@gmail.com>
Andrew Austin <andrewaclt@gmail.com> Andrew Austin <andrewaclt@gmail.com>
Andrew Balholm <andybalholm@gmail.com> Andrew Balholm <andybalholm@gmail.com>
Andrew Benton <andrewmbenton@gmail.com>
Andrew Bonventre <andybons@chromium.org> Andrew Bonventre <andybons@chromium.org>
Andrew Bursavich <abursavich@gmail.com> Andrew Bursavich <abursavich@gmail.com>
Andrew Ekstedt <andrew.ekstedt@gmail.com> Andrew Ekstedt <andrew.ekstedt@gmail.com>
@@ -109,7 +95,6 @@ Andy Balholm <andy@balholm.com>
Andy Davis <andy@bigandian.com> Andy Davis <andy@bigandian.com>
Andy Finkenstadt <afinkenstadt@zynga.com> Andy Finkenstadt <afinkenstadt@zynga.com>
Andy Maloney <asmaloney@gmail.com> Andy Maloney <asmaloney@gmail.com>
Andy Walker <walkeraj@gmail.com>
Anfernee Yongkun Gui <anfernee.gui@gmail.com> Anfernee Yongkun Gui <anfernee.gui@gmail.com>
Angelo Bulfone <mbulfone@gmail.com> Angelo Bulfone <mbulfone@gmail.com>
Anh Hai Trinh <anh.hai.trinh@gmail.com> Anh Hai Trinh <anh.hai.trinh@gmail.com>
@@ -119,13 +104,9 @@ Anthony Canino <anthony.canino1@gmail.com>
Anthony Eufemio <anthony.eufemio@gmail.com> Anthony Eufemio <anthony.eufemio@gmail.com>
Anthony Martin <ality@pbrane.org> Anthony Martin <ality@pbrane.org>
Anthony Starks <ajstarks@gmail.com> Anthony Starks <ajstarks@gmail.com>
Anthony Voutas <voutasaurus@gmail.com>
Anthony Woods <awoods@raintank.io> Anthony Woods <awoods@raintank.io>
Antoine Martin <antoine97.martin@gmail.com>
Antonio Bibiano <antbbn@gmail.com> Antonio Bibiano <antbbn@gmail.com>
Antonio Troina <thoeni@gmail.com>
Apisak Darakananda <pongad@gmail.com> Apisak Darakananda <pongad@gmail.com>
Apsalar
Aram Hăvărneanu <aram@mgk.ro> Aram Hăvărneanu <aram@mgk.ro>
Areski Belaid <areski@gmail.com> Areski Belaid <areski@gmail.com>
Arlo Breault <arlolra@gmail.com> Arlo Breault <arlolra@gmail.com>
@@ -142,16 +123,12 @@ Audrey Lim <audreylh@gmail.com>
Augusto Roman <aroman@gmail.com> Augusto Roman <aroman@gmail.com>
Aulus Egnatius Varialus <varialus@gmail.com> Aulus Egnatius Varialus <varialus@gmail.com>
awaw fumin <awawfumin@gmail.com> awaw fumin <awawfumin@gmail.com>
Awn Umar <awn@cryptolosophy.io>
Ayanamist Yang <ayanamist@gmail.com> Ayanamist Yang <ayanamist@gmail.com>
Aymerick Jéhanne <aymerick@jehanne.org> Aymerick Jéhanne <aymerick@jehanne.org>
Baiju Muthukadan <baiju.m.mail@gmail.com> Baiju Muthukadan <baiju.m.mail@gmail.com>
Bartosz Grzybowski <melkorm@gmail.com>
Bastian Ike <bastian.ike@gmail.com>
Ben Burkert <ben@benburkert.com> Ben Burkert <ben@benburkert.com>
Ben Lubar <ben.lubar@gmail.com> Ben Lubar <ben.lubar@gmail.com>
Ben Olive <sionide21@gmail.com> Ben Olive <sionide21@gmail.com>
Ben Shi <powerman1st@163.com>
Benjamin Black <b@b3k.us> Benjamin Black <b@b3k.us>
Benny Siegert <bsiegert@gmail.com> Benny Siegert <bsiegert@gmail.com>
Benoit Sigoure <tsunanet@gmail.com> Benoit Sigoure <tsunanet@gmail.com>
@@ -169,34 +146,25 @@ Brady Sullivan <brady@bsull.com>
Brendan Daniel Tracey <tracey.brendan@gmail.com> Brendan Daniel Tracey <tracey.brendan@gmail.com>
Brett Cannon <bcannon@gmail.com> Brett Cannon <bcannon@gmail.com>
Brian Dellisanti <briandellisanti@gmail.com> Brian Dellisanti <briandellisanti@gmail.com>
Brian Downs <brian.downs@gmail.com>
Brian G. Merrell <bgmerrell@gmail.com> Brian G. Merrell <bgmerrell@gmail.com>
Brian Gitonga Marete <marete@toshnix.com> <bgmarete@gmail.com> Brian Gitonga Marete <marete@toshnix.com> <bgmarete@gmail.com>
Brian Kennedy <btkennedy@gmail.com> Brian Kennedy <btkennedy@gmail.com>
Brian Ketelsen <bketelsen@gmail.com> Brian Ketelsen <bketelsen@gmail.com>
Brian Smith <ohohvi@gmail.com> Brian Smith <ohohvi@gmail.com>
Brian Starke <brian.starke@gmail.com>
Bryan Alexander <Kozical@msn.com> Bryan Alexander <Kozical@msn.com>
Bryan Ford <brynosaurus@gmail.com> Bryan Ford <brynosaurus@gmail.com>
Bulat Gaifullin <gaifullinbf@gmail.com>
Caine Tighe <arctanofyourface@gmail.com> Caine Tighe <arctanofyourface@gmail.com>
Caleb Spare <cespare@gmail.com> Caleb Spare <cespare@gmail.com>
Carl Chatfield <carlchatfield@gmail.com> Carl Chatfield <carlchatfield@gmail.com>
Carl Henrik Lunde <chlunde@ifi.uio.no>
Carl Johnson <me@carlmjohnson.net> Carl Johnson <me@carlmjohnson.net>
Carlisia Campos <carlisia@grokkingtech.io>
Carlo Alberto Ferraris <cafxx@strayorange.com>
Carlos Castillo <cookieo9@gmail.com> Carlos Castillo <cookieo9@gmail.com>
Carlos Cirello <uldericofilho@gmail.com> Carlos Cirello <uldericofilho@gmail.com>
Carolyn Van Slyck <me@carolynvanslyck.com>
Case Nelson <case.nelson@gmail.com> Case Nelson <case.nelson@gmail.com>
Casey Marshall <casey.marshall@gmail.com> Casey Marshall <casey.marshall@gmail.com>
Cezar Sá Espinola <cezarsa@gmail.com> Cezar Sá Espinola <cezarsa@gmail.com>
ChaiShushan <chaishushan@gmail.com> ChaiShushan <chaishushan@gmail.com>
Charles L. Dorian <cldorian@gmail.com> Charles L. Dorian <cldorian@gmail.com>
Charles Lee <zombie.fml@gmail.com> Charles Lee <zombie.fml@gmail.com>
Chew Choon Keat <choonkeat@gmail.com>
Chris Biscardi <chris@christopherbiscardi.com>
Chris Dollin <ehog.hedge@gmail.com> Chris Dollin <ehog.hedge@gmail.com>
Chris Farmiloe <chrisfarms@gmail.com> Chris Farmiloe <chrisfarms@gmail.com>
Chris Hines <chris.cs.guy@gmail.com> Chris Hines <chris.cs.guy@gmail.com>
@@ -205,7 +173,6 @@ Chris Jones <chris@cjones.org>
Chris Kastorff <encryptio@gmail.com> Chris Kastorff <encryptio@gmail.com>
Chris Lennert <calennert@gmail.com> Chris Lennert <calennert@gmail.com>
Chris McGee <sirnewton_01@yahoo.ca> <newton688@gmail.com> Chris McGee <sirnewton_01@yahoo.ca> <newton688@gmail.com>
Chris Roche <rodaine@gmail.com>
Chris Stockton <chrisstocktonaz@gmail.com> Chris Stockton <chrisstocktonaz@gmail.com>
Christian Couder <chriscool@tuxfamily.org> Christian Couder <chriscool@tuxfamily.org>
Christian Himpel <chressie@googlemail.com> Christian Himpel <chressie@googlemail.com>
@@ -221,7 +188,6 @@ Christopher Wedgwood <cw@f00f.org>
CL Sung <clsung@gmail.com> <cl_sung@htc.com> CL Sung <clsung@gmail.com> <cl_sung@htc.com>
Clement Skau <clementskau@gmail.com> Clement Skau <clementskau@gmail.com>
CloudFlare Inc. CloudFlare Inc.
Cody Oss <the.cody.oss@gmail.com>
Colin Edwards <colin@recursivepenguin.com> Colin Edwards <colin@recursivepenguin.com>
Colin Kennedy <moshen.colin@gmail.com> Colin Kennedy <moshen.colin@gmail.com>
Conrad Irwin <conrad.irwin@gmail.com> Conrad Irwin <conrad.irwin@gmail.com>
@@ -231,10 +197,7 @@ Corey Thomasson <cthom.lists@gmail.com>
Cristian Staretu <unclejacksons@gmail.com> Cristian Staretu <unclejacksons@gmail.com>
Currant Currant
Cyrill Schumacher <cyrill@schumacher.fm> Cyrill Schumacher <cyrill@schumacher.fm>
Daisuke Fujita <dtanshi45@gmail.com>
Damian Gryski <dgryski@gmail.com> Damian Gryski <dgryski@gmail.com>
Damien Lespiau <damien.lespiau@gmail.com>
Dan Ballard <dan@mindstab.net>
Dan Caddigan <goldcaddy77@gmail.com> Dan Caddigan <goldcaddy77@gmail.com>
Dan Callahan <dan.callahan@gmail.com> Dan Callahan <dan.callahan@gmail.com>
Dan Peterson <dpiddy@gmail.com> Dan Peterson <dpiddy@gmail.com>
@@ -250,11 +213,9 @@ Daniel Ortiz Pereira da Silva <daniel.particular@gmail.com>
Daniel Skinner <daniel@dasa.cc> Daniel Skinner <daniel@dasa.cc>
Daniel Speichert <daniel@speichert.pl> Daniel Speichert <daniel@speichert.pl>
Daniel Theophanes <kardianos@gmail.com> Daniel Theophanes <kardianos@gmail.com>
Daniel Upton <daniel@floppy.co>
Darren Elwood <darren@textnode.com> Darren Elwood <darren@textnode.com>
Datong Sun <dndx@idndx.com> Datong Sun <dndx@idndx.com>
Dave Cheney <dave@cheney.net> Dave Cheney <dave@cheney.net>
Dave MacFarlane <driusan@gmail.com>
David Brophy <dave@brophy.uk> David Brophy <dave@brophy.uk>
David Bürgin <676c7473@gmail.com> David Bürgin <676c7473@gmail.com>
David Calavera <david.calavera@gmail.com> David Calavera <david.calavera@gmail.com>
@@ -264,13 +225,11 @@ David G. Andersen <dave.andersen@gmail.com>
David Howden <dhowden@gmail.com> David Howden <dhowden@gmail.com>
David Jakob Fritz <david.jakob.fritz@gmail.com> David Jakob Fritz <david.jakob.fritz@gmail.com>
David Leon Gil <coruus@gmail.com> David Leon Gil <coruus@gmail.com>
David NewHamlet <david@newhamlet.com>
David R. Jenni <david.r.jenni@gmail.com> David R. Jenni <david.r.jenni@gmail.com>
David Sansome <me@davidsansome.com> David Sansome <me@davidsansome.com>
David Stainton <dstainton415@gmail.com> David Stainton <dstainton415@gmail.com>
David Thomas <davidthomas426@gmail.com> David Thomas <davidthomas426@gmail.com>
David Titarenco <david.titarenco@gmail.com> David Titarenco <david.titarenco@gmail.com>
David Volquartz Lebech <david@lebech.info>
Davies Liu <davies.liu@gmail.com> Davies Liu <davies.liu@gmail.com>
Dean Prichard <dean.prichard@gmail.com> Dean Prichard <dean.prichard@gmail.com>
Deepak Jois <deepak.jois@gmail.com> Deepak Jois <deepak.jois@gmail.com>
@@ -278,7 +237,6 @@ Denis Bernard <db047h@gmail.com>
Denis Brandolini <denis.brandolini@gmail.com> Denis Brandolini <denis.brandolini@gmail.com>
Denys Honsiorovskyi <honsiorovskyi@gmail.com> Denys Honsiorovskyi <honsiorovskyi@gmail.com>
Derek Buitenhuis <derek.buitenhuis@gmail.com> Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek McGowan <derek@mcgstyle.net>
Derek Parker <parkerderek86@gmail.com> Derek Parker <parkerderek86@gmail.com>
Derek Shockey <derek.shockey@gmail.com> Derek Shockey <derek.shockey@gmail.com>
Develer SRL Develer SRL
@@ -296,10 +254,8 @@ Dmitriy Shelenin <deemok@googlemail.com> <deemok@gmail.com>
Dmitry Chestnykh <dchest@gmail.com> Dmitry Chestnykh <dchest@gmail.com>
Dmitry Savintsev <dsavints@gmail.com> Dmitry Savintsev <dsavints@gmail.com>
Dmitry Yakunin <nonamezeil@gmail.com> Dmitry Yakunin <nonamezeil@gmail.com>
Dominic Green <dominicgreen1@gmail.com>
Dominik Honnef <dominik.honnef@gmail.com> Dominik Honnef <dominik.honnef@gmail.com>
Donald Huang <don.hcd@gmail.com> Donald Huang <don.hcd@gmail.com>
Dong-hee Na <donghee.na92@gmail.com>
Donovan Hide <donovanhide@gmail.com> Donovan Hide <donovanhide@gmail.com>
Dropbox, Inc. Dropbox, Inc.
Duncan Holm <mail@frou.org> Duncan Holm <mail@frou.org>
@@ -307,21 +263,17 @@ Dustin Herbison <djherbis@gmail.com>
Dustin Sallings <dsallings@gmail.com> Dustin Sallings <dsallings@gmail.com>
Dustin Shields-Cloues <dcloues@gmail.com> Dustin Shields-Cloues <dcloues@gmail.com>
Dvir Volk <dvir@everything.me> <dvirsky@gmail.com> Dvir Volk <dvir@everything.me> <dvirsky@gmail.com>
Dylan Waits <dylan@waits.io>
Eden Li <eden.li@gmail.com> Eden Li <eden.li@gmail.com>
Edward Muller <edwardam@interlix.com> Edward Muller <edwardam@interlix.com>
Egon Elbre <egonelbre@gmail.com> Egon Elbre <egonelbre@gmail.com>
Ehren Kret <ehren.kret@gmail.com> Ehren Kret <ehren.kret@gmail.com>
Eitan Adler <lists@eitanadler.com>
Eivind Uggedal <eivind@uggedal.com> Eivind Uggedal <eivind@uggedal.com>
Elias Naur <elias.naur@gmail.com> Elias Naur <elias.naur@gmail.com>
Elliot Morrison-Reed <elliotmr@gmail.com> Elliot Morrison-Reed <elliotmr@gmail.com>
Emil Hessman <c.emil.hessman@gmail.com> <emil@hessman.se> Emil Hessman <c.emil.hessman@gmail.com> <emil@hessman.se>
Emilien Kenler <hello@emilienkenler.com>
Emmanuel Odeke <emm.odeke@gmail.com> <odeke@ualberta.ca> Emmanuel Odeke <emm.odeke@gmail.com> <odeke@ualberta.ca>
Empirical Interfaces Inc. Empirical Interfaces Inc.
Eoghan Sherry <ejsherry@gmail.com> Eoghan Sherry <ejsherry@gmail.com>
Eric Chiang <eric.chiang.m@gmail.com>
Eric Clark <zerohp@gmail.com> Eric Clark <zerohp@gmail.com>
Eric Engestrom <eric@engestrom.ch> Eric Engestrom <eric@engestrom.ch>
Eric Lagergren <ericscottlagergren@gmail.com> Eric Lagergren <ericscottlagergren@gmail.com>
@@ -334,26 +286,18 @@ Erik Westrup <erik.westrup@gmail.com>
Ernest Chiang <ernest_chiang@htc.com> Ernest Chiang <ernest_chiang@htc.com>
Esko Luontola <esko.luontola@gmail.com> Esko Luontola <esko.luontola@gmail.com>
Euan Kemp <euank@euank.com> Euan Kemp <euank@euank.com>
Evan Hicks <evan.hicks2@gmail.com>
Evan Phoenix <evan@phx.io> Evan Phoenix <evan@phx.io>
Evan Shaw <chickencha@gmail.com> Evan Shaw <chickencha@gmail.com>
Evgeniy Polyakov <zbr@ioremap.net>
Ewan Chou <coocood@gmail.com> Ewan Chou <coocood@gmail.com>
Ewan Valentine <ewan.valentine89@gmail.com>
Eyal Posener <posener@gmail.com>
Fabian Wickborn <fabian@wickborn.net> Fabian Wickborn <fabian@wickborn.net>
Fabian Zaremba <fabian@youremail.eu>
Fabrizio Milo <mistobaan@gmail.com> Fabrizio Milo <mistobaan@gmail.com>
Facebook, Inc.
Faiyaz Ahmed <ahmedf@vmware.com> Faiyaz Ahmed <ahmedf@vmware.com>
Fan Hongjian <fan.howard@gmail.com> Fan Hongjian <fan.howard@gmail.com>
Fastly, Inc. Fastly, Inc.
Fatih Arslan <fatih@arslan.io> Fatih Arslan <fatih@arslan.io>
Fazlul Shahriar <fshahriar@gmail.com> Fazlul Shahriar <fshahriar@gmail.com>
Fedor Indutny <fedor@indutny.com> Fedor Indutny <fedor@indutny.com>
Felipe Oliveira <felipeweb.programador@gmail.com>
Felix Geisendörfer <haimuiba@gmail.com> Felix Geisendörfer <haimuiba@gmail.com>
Filip Gruszczyński <gruszczy@gmail.com>
Filippo Valsorda <hi@filippo.io> Filippo Valsorda <hi@filippo.io>
Firmansyah Adiputra <frm.adiputra@gmail.com> Firmansyah Adiputra <frm.adiputra@gmail.com>
Florian Uekermann <florian@uekermann-online.de> Florian Uekermann <florian@uekermann-online.de>
@@ -361,26 +305,20 @@ Florian Weimer <fw@deneb.enyo.de>
Florin Patan <florinpatan@gmail.com> Florin Patan <florinpatan@gmail.com>
Ford Hurley <ford.hurley@gmail.com> Ford Hurley <ford.hurley@gmail.com>
Francisco Claude <fclaude@recoded.cl> Francisco Claude <fclaude@recoded.cl>
Francisco Rojas <francisco.rojas.gallegos@gmail.com>
Francisco Souza <franciscossouza@gmail.com> Francisco Souza <franciscossouza@gmail.com>
Frederick Kelly Mayle III <frederickmayle@gmail.com> Frederick Kelly Mayle III <frederickmayle@gmail.com>
Fredrik Enestad <fredrik.enestad@soundtrackyourbrand.com> Fredrik Enestad <fredrik.enestad@soundtrackyourbrand.com>
Fredrik Forsmo <fredrik.forsmo@gmail.com>
Frithjof Schulze <schulze@math.uni-hannover.de> <sfrithjof@gmail.com> Frithjof Schulze <schulze@math.uni-hannover.de> <sfrithjof@gmail.com>
Frits van Bommel <fvbommel@gmail.com> Frits van Bommel <fvbommel@gmail.com>
Gabríel Arthúr Pétursson <gabriel@system.is>
Gabriel Aszalos <gabriel.aszalos@gmail.com> Gabriel Aszalos <gabriel.aszalos@gmail.com>
Gabriel Nicolas Avellaneda <avellaneda.gabriel@gmail.com>
Gabriel Russell <gabriel.russell@gmail.com> Gabriel Russell <gabriel.russell@gmail.com>
Gareth Paul Jones <gpj@foursquare.com> Gareth Paul Jones <gpj@foursquare.com>
Gary Burd <gary@beagledreams.com> Gary Burd <gary@beagledreams.com>
Gaurish Sharma <contact@gaurishsharma.com> Gaurish Sharma <contact@gaurishsharma.com>
Gautham Thambidorai <gautham.dorai@gmail.com> Gautham Thambidorai <gautham.dorai@gmail.com>
Geert-Johan Riemer <gjr19912@gmail.com> Geert-Johan Riemer <gjr19912@gmail.com>
Gengliang Wang <ltnwgl@gmail.com>
Geoffroy Lorieux <lorieux.g@gmail.com> Geoffroy Lorieux <lorieux.g@gmail.com>
Georg Reinke <guelfey@gmail.com> Georg Reinke <guelfey@gmail.com>
George Gkirtsou <ggirtsou@gmail.com>
George Shammas <george@shamm.as> <georgyo@gmail.com> George Shammas <george@shamm.as> <georgyo@gmail.com>
Gerasimos Dimitriadis <gedimitr@gmail.com> Gerasimos Dimitriadis <gedimitr@gmail.com>
Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com> Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
@@ -391,47 +329,37 @@ Google Inc.
Gordon Klaus <gordon.klaus@gmail.com> Gordon Klaus <gordon.klaus@gmail.com>
Graham King <graham4king@gmail.com> Graham King <graham4king@gmail.com>
Graham Miller <graham.miller@gmail.com> Graham Miller <graham.miller@gmail.com>
Greg Poirier <greg.istehbest@gmail.com>
Greg Ward <greg@gerg.ca> Greg Ward <greg@gerg.ca>
Gregory Man <man.gregory@gmail.com>
Guillaume J. Charmes <guillaume@charmes.net> Guillaume J. Charmes <guillaume@charmes.net>
Guobiao Mei <meiguobiao@gmail.com> Guobiao Mei <meiguobiao@gmail.com>
Gustav Paul <gustav.paul@gmail.com> Gustav Paul <gustav.paul@gmail.com>
Gustav Westling <gustav@westling.xyz>
Gustavo Niemeyer <gustavo@niemeyer.net> Gustavo Niemeyer <gustavo@niemeyer.net>
Gwenael Treguier <gwenn.kahz@gmail.com> Gwenael Treguier <gwenn.kahz@gmail.com>
Gyu-Ho Lee <gyuhox@gmail.com> Gyu-Ho Lee <gyuhox@gmail.com>
H. İbrahim Güngör <igungor@gmail.com> H. İbrahim Güngör <igungor@gmail.com>
Hajime Hoshi <hajimehoshi@gmail.com> Hajime Hoshi <hajimehoshi@gmail.com>
Hang Qian <hangqian90@gmail.com>
Hari haran <hariharan.uno@gmail.com> Hari haran <hariharan.uno@gmail.com>
Hariharan Srinath <srinathh@gmail.com> Hariharan Srinath <srinathh@gmail.com>
Harley Laue <losinggeneration@gmail.com> Harley Laue <losinggeneration@gmail.com>
Harry Moreno <morenoh149@gmail.com> Harry Moreno <morenoh149@gmail.com>
Harshavardhana <hrshvardhana@gmail.com> Harshavardhana <hrshvardhana@gmail.com>
Hauke Löffler <hloeffler@users.noreply.github.com>
Håvard Haugen <havard.haugen@gmail.com> Håvard Haugen <havard.haugen@gmail.com>
Hector Chu <hectorchu@gmail.com> Hector Chu <hectorchu@gmail.com>
Hector Martin Cantero <hector@marcansoft.com> Hector Martin Cantero <hector@marcansoft.com>
Henning Schmiedehausen <henning@schmiedehausen.org> Henning Schmiedehausen <henning@schmiedehausen.org>
Henrik Edwards <henrik.edwards@gmail.com> Henrik Edwards <henrik.edwards@gmail.com>
Henrik Hodne <henrik@hodne.io> Henrik Hodne <henrik@hodne.io>
Henry Chang <mr.changyuheng@gmail.com>
Herbert Georg Fischer <herbert.fischer@gmail.com> Herbert Georg Fischer <herbert.fischer@gmail.com>
Hironao OTSUBO <motemen@gmail.com> Hironao OTSUBO <motemen@gmail.com>
Hiroshi Ioka <hirochachacha@gmail.com> Hiroshi Ioka <hirochachacha@gmail.com>
Hitoshi Mitake <mitake.hitoshi@gmail.com> Hitoshi Mitake <mitake.hitoshi@gmail.com>
Holden Huang <ttyh061@gmail.com> Holden Huang <ttyh061@gmail.com>
Hong Ruiqi <hongruiqi@gmail.com> Hong Ruiqi <hongruiqi@gmail.com>
Hongfei Tan <feilengcui008@gmail.com>
Hsin-Ho Yeh <yhh92u@gmail.com> Hsin-Ho Yeh <yhh92u@gmail.com>
Hu Keping <hukeping@huawei.com> Hu Keping <hukeping@huawei.com>
Hugues Bruant <hugues.bruant@gmail.com>
Ian Gudger <ian@loosescre.ws> Ian Gudger <ian@loosescre.ws>
IBM IBM
Ibrahim AshShohail <ibra.sho@gmail.com>
Icarus Sparry <golang@icarus.freeuk.com> Icarus Sparry <golang@icarus.freeuk.com>
Iccha Sethi <icchasethi@gmail.com>
Idora Shinatose <idora.shinatose@gmail.com> Idora Shinatose <idora.shinatose@gmail.com>
Igneous Systems, Inc. Igneous Systems, Inc.
Igor Dolzhikov <bluesriverz@gmail.com> Igor Dolzhikov <bluesriverz@gmail.com>
@@ -442,7 +370,6 @@ Intel Corporation
Irieda Noboru <irieda@gmail.com> Irieda Noboru <irieda@gmail.com>
Isaac Wagner <ibw@isaacwagner.me> Isaac Wagner <ibw@isaacwagner.me>
Ivan Babrou <ivan@cloudflare.com> Ivan Babrou <ivan@cloudflare.com>
Ivan Moscoso <moscoso@gmail.com>
Ivan Ukhov <ivan.ukhov@gmail.com> Ivan Ukhov <ivan.ukhov@gmail.com>
Jacob Hoffman-Andrews <github@hoffman-andrews.com> Jacob Hoffman-Andrews <github@hoffman-andrews.com>
Jae Kwon <jae@tendermint.com> Jae Kwon <jae@tendermint.com>
@@ -450,33 +377,25 @@ Jakob Borg <jakob@nym.se>
Jakub Ryszard Czarnowicz <j.czarnowicz@gmail.com> Jakub Ryszard Czarnowicz <j.czarnowicz@gmail.com>
James Bardin <j.bardin@gmail.com> James Bardin <j.bardin@gmail.com>
James Clarke <jrtc27@jrtc27.com> James Clarke <jrtc27@jrtc27.com>
James Cowgill <James.Cowgill@imgtec.com>
James David Chalfant <james.chalfant@gmail.com> James David Chalfant <james.chalfant@gmail.com>
James Fysh <james.fysh@gmail.com> James Fysh <james.fysh@gmail.com>
James Gray <james@james4k.com> James Gray <james@james4k.com>
James Hartig <fastest963@gmail.com>
James Meneghello <rawrz0r@gmail.com> James Meneghello <rawrz0r@gmail.com>
James Myers <jfmyers9@gmail.com>
James Neve <jamesoneve@gmail.com>
James P. Cooper <jamespcooper@gmail.com> James P. Cooper <jamespcooper@gmail.com>
James Schofield <james@shoeboxapp.com> James Schofield <james@shoeboxapp.com>
James Smith <jrs1995@icloud.com>
James Sweet <james.sweet88@googlemail.com> James Sweet <james.sweet88@googlemail.com>
James Toy <nil@opensesame.st> James Toy <nil@opensesame.st>
James Whitehead <jnwhiteh@gmail.com> James Whitehead <jnwhiteh@gmail.com>
Jamie Beverly <jamie.r.beverly@gmail.com> Jamie Beverly <jamie.r.beverly@gmail.com>
Jamie Kerr <jkerr113@googlemail.com>
Jamie Stackhouse <contin673@gmail.com>
Jamil Djadala <djadala@gmail.com> Jamil Djadala <djadala@gmail.com>
Jan Berktold <jan@berktold.co>
Jan H. Hosang <jan.hosang@gmail.com> Jan H. Hosang <jan.hosang@gmail.com>
Jan Mercl <0xjnml@gmail.com> <befelemepeseveze@gmail.com> Jan Mercl <0xjnml@gmail.com>
Jan Mercl <befelemepeseveze@gmail.com>
Jan Newmarch <jan.newmarch@gmail.com> Jan Newmarch <jan.newmarch@gmail.com>
Jan Ziak <0xe2.0x9a.0x9b@gmail.com> Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Jani Monoses <jani.monoses@ubuntu.com> Jani Monoses <jani.monoses@ubuntu.com>
Jaroslavas Počepko <jp@webmaster.ms> Jaroslavas Počepko <jp@webmaster.ms>
Jason Barnett <jason.w.barnett@gmail.com> Jason Barnett <jason.w.barnett@gmail.com>
Jason Chu <jasonchujc@gmail.com>
Jason Del Ponte <delpontej@gmail.com> Jason Del Ponte <delpontej@gmail.com>
Jason Smale <jsmale@zendesk.com> Jason Smale <jsmale@zendesk.com>
Jason Travis <infomaniac7@gmail.com> Jason Travis <infomaniac7@gmail.com>
@@ -486,7 +405,6 @@ Jeff Hodges <jeff@somethingsimilar.com>
Jeff R. Allen <jra@nella.org> Jeff R. Allen <jra@nella.org>
Jeff Sickel <jas@corpus-callosum.com> Jeff Sickel <jas@corpus-callosum.com>
Jeff Wendling <jeff@spacemonkey.com> Jeff Wendling <jeff@spacemonkey.com>
Jeffrey H <jeffreyh192@gmail.com>
Jens Frederich <jfrederich@gmail.com> Jens Frederich <jfrederich@gmail.com>
Jeremy Jackins <jeremyjackins@gmail.com> Jeremy Jackins <jeremyjackins@gmail.com>
Jeroen Bobbeldijk <jerbob92@gmail.com> Jeroen Bobbeldijk <jerbob92@gmail.com>
@@ -495,7 +413,6 @@ Jesse Szwedko <jesse.szwedko@gmail.com>
Jihyun Yu <yjh0502@gmail.com> Jihyun Yu <yjh0502@gmail.com>
Jim McGrath <jimmc2@gmail.com> Jim McGrath <jimmc2@gmail.com>
Jimmy Zelinskie <jimmyzelinskie@gmail.com> Jimmy Zelinskie <jimmyzelinskie@gmail.com>
Jin-wook Jeong <jeweljar@hanmail.net>
Jingcheng Zhang <diogin@gmail.com> Jingcheng Zhang <diogin@gmail.com>
Jingguo Yao <yaojingguo@gmail.com> Jingguo Yao <yaojingguo@gmail.com>
Jiong Du <londevil@gmail.com> Jiong Du <londevil@gmail.com>
@@ -504,14 +421,11 @@ Joakim Sernbrant <serbaut@gmail.com>
Joe Farrell <joe2farrell@gmail.com> Joe Farrell <joe2farrell@gmail.com>
Joe Harrison <joehazzers@gmail.com> Joe Harrison <joehazzers@gmail.com>
Joe Henke <joed.henke@gmail.com> Joe Henke <joed.henke@gmail.com>
Joe Kyo <xunianzu@gmail.com>
Joe Poirier <jdpoirier@gmail.com> Joe Poirier <jdpoirier@gmail.com>
Joe Shaw <joe@joeshaw.org> Joe Shaw <joe@joeshaw.org>
Joe Sylve <joe.sylve@gmail.com> Joe Sylve <joe.sylve@gmail.com>
Joe Tsai <joetsai@digital-static.net> Joe Tsai <joetsai@digital-static.net>
Joel Stemmer <stemmertech@gmail.com> Joel Stemmer <stemmertech@gmail.com>
Joey Geiger <jgeiger@users.noreply.github.com>
Johan Brandhorst <johan.brandhorst@gmail.com>
Johan Sageryd <j@1616.se> Johan Sageryd <j@1616.se>
John Asmuth <jasmuth@gmail.com> John Asmuth <jasmuth@gmail.com>
John C Barstow <jbowtie@amathaine.com> John C Barstow <jbowtie@amathaine.com>
@@ -520,34 +434,26 @@ John Howard Palevich <jack.palevich@gmail.com>
John Jeffery <jjeffery@sp.com.au> John Jeffery <jjeffery@sp.com.au>
John Jenkins <twodopeshaggy@gmail.com> John Jenkins <twodopeshaggy@gmail.com>
John Potocny <johnp@vividcortex.com> John Potocny <johnp@vividcortex.com>
John R. Lenton <jlenton@gmail.com>
John Schnake <schnake.john@gmail.com> John Schnake <schnake.john@gmail.com>
John Shahid <jvshahid@gmail.com> John Shahid <jvshahid@gmail.com>
John Tuley <john@tuley.org> John Tuley <john@tuley.org>
Johnny Luo <johnnyluo1980@gmail.com>
Jonathan Boulle <jonathanboulle@gmail.com> Jonathan Boulle <jonathanboulle@gmail.com>
Jonathan Gold <jgold.bg@gmail.com> Jonathan Gold <jgold.bg@gmail.com>
Jonathan Mark <jhmark@xenops.com> Jonathan Mark <jhmark@xenops.com>
Jonathan Rudenberg <jonathan@titanous.com> Jonathan Rudenberg <jonathan@titanous.com>
Jonathan Stacks <jonstacks13@gmail.com>
Jonathan Wills <runningwild@gmail.com> Jonathan Wills <runningwild@gmail.com>
Jongmin Kim <atomaths@gmail.com> Jongmin Kim <atomaths@gmail.com>
Joonas Kuorilehto <joneskoo@derbian.fi> Joonas Kuorilehto <joneskoo@derbian.fi>
Joop Kiefte <ikojba@gmail.com> <joop@kiefte.net> Joop Kiefte <ikojba@gmail.com> <joop@kiefte.net>
Jordan Krage <jmank88@gmail.com>
Jordan Lewis <jordanthelewis@gmail.com> Jordan Lewis <jordanthelewis@gmail.com>
Jose Luis Vázquez González <josvazg@gmail.com> Jose Luis Vázquez González <josvazg@gmail.com>
Joseph Holsten <joseph@josephholsten.com> Joseph Holsten <joseph@josephholsten.com>
Josh Bleecher Snyder <josharian@gmail.com> Josh Bleecher Snyder <josharian@gmail.com>
Josh Chorlton <jchorlton@gmail.com> Josh Chorlton <jchorlton@gmail.com>
Josh Deprez <josh.deprez@gmail.com>
Josh Goebel <dreamer3@gmail.com> Josh Goebel <dreamer3@gmail.com>
Josh Holland <jrh@joshh.co.uk> Josh Holland <jrh@joshh.co.uk>
Josh Roppo <joshroppo@gmail.com>
Joshua Chase <jcjoshuachase@gmail.com> Joshua Chase <jcjoshuachase@gmail.com>
Josselin Costanzi <josselin@costanzi.fr>
Jostein Stuhaug <js@solidsystem.no> Jostein Stuhaug <js@solidsystem.no>
Joyent, Inc.
JT Olds <jtolds@xnet5.com> JT Olds <jtolds@xnet5.com>
Jukka-Pekka Kekkonen <karatepekka@gmail.com> Jukka-Pekka Kekkonen <karatepekka@gmail.com>
Julian Kornberger <jk+github@digineo.de> Julian Kornberger <jk+github@digineo.de>
@@ -556,21 +462,14 @@ Julien Schmidt <google@julienschmidt.com>
Justin Nuß <nuss.justin@gmail.com> Justin Nuß <nuss.justin@gmail.com>
Justyn Temme <justyntemme@gmail.com> Justyn Temme <justyntemme@gmail.com>
Kai Backman <kaib@golang.org> Kai Backman <kaib@golang.org>
Kai Trukenmüller <ktye78@gmail.com>
Kale Blankenship <kale@lemnisys.com> Kale Blankenship <kale@lemnisys.com>
Kaleb Elwert <kelwert@atlassian.com>
Kamil Chmielewski <kamil.chm@gmail.com>
Kamil Kisiel <kamil@kamilkisiel.net> <kamil.kisiel@gmail.com> Kamil Kisiel <kamil@kamilkisiel.net> <kamil.kisiel@gmail.com>
Kang Hu <hukangustc@gmail.com> Kang Hu <hukangustc@gmail.com>
Karoly Negyesi <chx1975@gmail.com>
Kashav Madan <kshvmdn@gmail.com>
Kate Manson <kate.manson@izettle.com>
Kato Kazuyoshi <kato.kazuyoshi@gmail.com> Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Katrina Owen <katrina.owen@gmail.com> Katrina Owen <katrina.owen@gmail.com>
Kaviraj Kanagaraj <kavirajkanagaraj@gmail.com> Kaviraj Kanagaraj <kavirajkanagaraj@gmail.com>
Keegan Carruthers-Smith <keegan.csmith@gmail.com> Keegan Carruthers-Smith <keegan.csmith@gmail.com>
Kei Son <hey.calmdown@gmail.com> Kei Son <hey.calmdown@gmail.com>
Keiji Yoshida <keijiyoshida.mail@gmail.com>
Keith Ball <inflatablewoman@gmail.com> Keith Ball <inflatablewoman@gmail.com>
Keith Rarick <kr@xph.us> Keith Rarick <kr@xph.us>
Kelsey Hightower <kelsey.hightower@gmail.com> Kelsey Hightower <kelsey.hightower@gmail.com>
@@ -585,51 +484,33 @@ Kevin Ballard <kevin@sb.org>
Kevin Burke <kev@inburke.com> Kevin Burke <kev@inburke.com>
Kevin Kirsche <kev.kirsche@gmail.com> Kevin Kirsche <kev.kirsche@gmail.com>
Kevin Vu <kevin.m.vu@gmail.com> Kevin Vu <kevin.m.vu@gmail.com>
Kim Yongbin <kybinz@gmail.com>
Klaus Post <klauspost@gmail.com> Klaus Post <klauspost@gmail.com>
Kodie Goodwin <kodiegoodwin@gmail.com>
Koichi Shiraishi <zchee.io@gmail.com>
Koki Ide <niconegoto@yahoo.co.jp>
Konstantin <konstantin8105@gmail.com>
Konstantin Shaposhnikov <k.shaposhnikov@gmail.com> Konstantin Shaposhnikov <k.shaposhnikov@gmail.com>
KPCompass, Inc. KPCompass, Inc.
Kris Nova <kris@nivenly.com>
Kristopher Watts <traetox@gmail.com> Kristopher Watts <traetox@gmail.com>
Kun Li <likunarmstrong@gmail.com> Kun Li <likunarmstrong@gmail.com>
Kyle Consalus <consalus@gmail.com> Kyle Consalus <consalus@gmail.com>
Kyle Isom <kyle@gokyle.net> Kyle Isom <kyle@gokyle.net>
Kyle Jones <kyle@kyledj.com>
Kyle Lemons <kyle@kylelemons.net> Kyle Lemons <kyle@kylelemons.net>
Kyrylo Silin <silin@kyrylo.org>
L Campbell <unpantsu@gmail.com> L Campbell <unpantsu@gmail.com>
Lai Jiangshan <eag0628@gmail.com> Lai Jiangshan <eag0628@gmail.com>
Lars Jeppesen <jeppesen.lars@gmail.com>
Lars Wiegman <lars@namsral.com>
Larz Conwell <larzconwell@gmail.com> Larz Conwell <larzconwell@gmail.com>
Laurie Clark-Michalek <laurie@qubit.com>
LE Manh Cuong <cuong.manhle.vn@gmail.com> LE Manh Cuong <cuong.manhle.vn@gmail.com>
Lee Hinman <hinman@gmail.com> Lee Hinman <hinman@gmail.com>
Lee Packham <lpackham@gmail.com> Lee Packham <lpackham@gmail.com>
Leon Klingele <git@leonklingele.de>
Lev Shamardin <shamardin@gmail.com>
Lewin Bormann <lewin.bormann@gmail.com> Lewin Bormann <lewin.bormann@gmail.com>
Liberty Fund Inc Liberty Fund Inc
Linaro Limited Linaro Limited
Lion Yang <lion@aosc.xyz>
Lloyd Dewolf <foolswisdom@gmail.com> Lloyd Dewolf <foolswisdom@gmail.com>
Lorenzo Masini <rugginoso@develer.com>
Lorenzo Stoakes <lstoakes@gmail.com> Lorenzo Stoakes <lstoakes@gmail.com>
Luan Santos <cfcluan@gmail.com> Luan Santos <cfcluan@gmail.com>
Luca Greco <luca.greco@alcacoop.it> Luca Greco <luca.greco@alcacoop.it>
Lucas Bremgartner <lucas.bremgartner@gmail.com>
Lucien Stuker <lucien.stuker@gmail.com> Lucien Stuker <lucien.stuker@gmail.com>
Lucio De Re <lucio.dere@gmail.com> Lucio De Re <lucio.dere@gmail.com>
Ludi Rehak <ludi317@gmail.com>
Luigi Riefolo <luigi.riefolo@gmail.com> Luigi Riefolo <luigi.riefolo@gmail.com>
Luit van Drongelen <luitvd@gmail.com> Luit van Drongelen <luitvd@gmail.com>
Luka Zakrajšek <tr00.g33k@gmail.com> Luka Zakrajšek <tr00.g33k@gmail.com>
Luke Curley <qpingu@gmail.com> Luke Curley <qpingu@gmail.com>
Ma Peiqi <mapeiqi2017@gmail.com>
Maksym Trykur <maksym.trykur@gmail.com> Maksym Trykur <maksym.trykur@gmail.com>
Mal Curtis <mal@mal.co.nz> Mal Curtis <mal@mal.co.nz>
Manfred Touron <m@42.am> Manfred Touron <m@42.am>
@@ -637,15 +518,12 @@ Manu S Ajith <neo@codingarena.in>
Manuel Mendez <mmendez534@gmail.com> Manuel Mendez <mmendez534@gmail.com>
Marc Weistroff <marc@weistroff.net> Marc Weistroff <marc@weistroff.net>
Marcel Edmund Franke <marcel.edmund.franke@gmail.com> Marcel Edmund Franke <marcel.edmund.franke@gmail.com>
Marcelo E. Magallon <marcelo.magallon@gmail.com>
Marco Hennings <marco.hennings@freiheit.com> Marco Hennings <marco.hennings@freiheit.com>
Marin Bašić <marin.basic02@gmail.com> Marin Bašić <marin.basic02@gmail.com>
Mark Adams <mark@markadams.me>
Mark Bucciarelli <mkbucc@gmail.com> Mark Bucciarelli <mkbucc@gmail.com>
Mark Severson <miquella@gmail.com> Mark Severson <miquella@gmail.com>
Mark Theunissen <mark.theunissen@gmail.com> Mark Theunissen <mark.theunissen@gmail.com>
Marko Juhani Silokunnas <marko.silokunnas@gmail.com> Marko Juhani Silokunnas <marko.silokunnas@gmail.com>
Marko Mudrinic <mudrinic.mare@gmail.com>
Marko Tiikkaja <marko@joh.to> Marko Tiikkaja <marko@joh.to>
Markover Inc. DBA Poptip Markover Inc. DBA Poptip
Markus Duft <markus.duft@salomon.at> Markus Duft <markus.duft@salomon.at>
@@ -654,37 +532,23 @@ Markus Zimmermann <zimmski@gmail.com>
Martin Bertschler <mbertschler@gmail.com> Martin Bertschler <mbertschler@gmail.com>
Martin Garton <garton@gmail.com> Martin Garton <garton@gmail.com>
Martin Hamrle <martin.hamrle@gmail.com> Martin Hamrle <martin.hamrle@gmail.com>
Martin Hoefling <martin.hoefling@gmx.de>
Martin Lindhe <martin.j.lindhe@gmail.com>
Martin Möhrmann <martisch@uos.de> Martin Möhrmann <martisch@uos.de>
Martin Neubauer <m.ne@gmx.net> Martin Neubauer <m.ne@gmx.net>
Martin Olsen <github.com@martinolsen.net>
Martin Olsson <martin@minimum.se> Martin Olsson <martin@minimum.se>
Martin Probst <martin@probst.io>
Marvin Stenger <marvin.stenger94@gmail.com> Marvin Stenger <marvin.stenger94@gmail.com>
Marwan Sulaiman <marwan.sulaiman@work.co>
Maryan Hratson <gmarik@gmail.com>
Masahiro Furudate <masahiro.furudate@gmail.com>
Masahiro Wakame <vvakame@gmail.com>
Masaki Yoshida <yoshida.masaki@gmail.com>
Máté Gulyás <mgulyas86@gmail.com>
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czapliński <czapkofan@gmail.com>
Mathias Beke <git@denbeke.be> Mathias Beke <git@denbeke.be>
Mathias Hall-Andersen <mathias@hall-andersen.dk>
Mathias Leppich <mleppich@muhqu.de> Mathias Leppich <mleppich@muhqu.de>
Mathieu Lonjaret <mathieu.lonjaret@gmail.com> Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
Mats Lidell <mats.lidell@cag.se> Mats Lidell <mats.lidell@cag.se>
Matt Aimonetti <mattaimonetti@gmail.com> Matt Aimonetti <mattaimonetti@gmail.com>
Matt Blair <me@matthewblair.net>
Matt Bostock <matt@mattbostock.com> Matt Bostock <matt@mattbostock.com>
Matt Drollette <matt@drollette.com> Matt Drollette <matt@drollette.com>
Matt Harden <matt.harden@gmail.com>
Matt Jibson <matt.jibson@gmail.com> Matt Jibson <matt.jibson@gmail.com>
Matt Joiner <anacrolix@gmail.com> Matt Joiner <anacrolix@gmail.com>
Matt Layher <mdlayher@gmail.com> Matt Layher <mdlayher@gmail.com>
Matt Reiferson <mreiferson@gmail.com> Matt Reiferson <mreiferson@gmail.com>
Matt Robenolt <matt@ydekproductions.com> Matt Robenolt <matt@ydekproductions.com>
Matt Strong <mstrong1341@gmail.com>
Matt T. Proud <matt.proud@gmail.com> Matt T. Proud <matt.proud@gmail.com>
Matt Williams <gh@mattyw.net> Matt Williams <gh@mattyw.net>
Matthew Brennan <matty.brennan@gmail.com> Matthew Brennan <matty.brennan@gmail.com>
@@ -696,8 +560,6 @@ Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
Matthieu Olivier <olivier.matthieu@gmail.com> Matthieu Olivier <olivier.matthieu@gmail.com>
Max Riveiro <kavu13@gmail.com> Max Riveiro <kavu13@gmail.com>
Maxim Khitrov <max@mxcrypt.com> Maxim Khitrov <max@mxcrypt.com>
Maxime de Roucy <maxime.deroucy@gmail.com>
Máximo Cuadros Ortiz <mcuadros@gmail.com>
Maxwell Krohn <themax@gmail.com> Maxwell Krohn <themax@gmail.com>
MediaMath, Inc MediaMath, Inc
Meir Fischer <meirfischer@gmail.com> Meir Fischer <meirfischer@gmail.com>
@@ -706,11 +568,9 @@ Meteor Development Group
Mhd Sulhan <m.shulhan@gmail.com> Mhd Sulhan <m.shulhan@gmail.com>
Micah Stetson <micah.stetson@gmail.com> Micah Stetson <micah.stetson@gmail.com>
Michael Chaten <mchaten@gmail.com> Michael Chaten <mchaten@gmail.com>
Michael Edwards <medwards@walledcity.ca>
Michael Elkins <michael.elkins@gmail.com> Michael Elkins <michael.elkins@gmail.com>
Michael Fraenkel <michael.fraenkel@gmail.com> Michael Fraenkel <michael.fraenkel@gmail.com>
Michael Gehring <mg@ebfe.org> <gnirheg.leahcim@gmail.com> Michael Gehring <mg@ebfe.org> <gnirheg.leahcim@gmail.com>
Michael Hendricks <michael@ndrix.org>
Michael Hoisie <hoisie@gmail.com> Michael Hoisie <hoisie@gmail.com>
Michael Käufl <golang@c.michael-kaeufl.de> Michael Käufl <golang@c.michael-kaeufl.de>
Michael Lewis <mikelikespie@gmail.com> Michael Lewis <mikelikespie@gmail.com>
@@ -725,7 +585,6 @@ Michal Bohuslávek <mbohuslavek@gmail.com>
Michał Derkacz <ziutek@lnet.pl> Michał Derkacz <ziutek@lnet.pl>
Miek Gieben <miek@miek.nl> Miek Gieben <miek@miek.nl>
Miguel Mendez <stxmendez@gmail.com> Miguel Mendez <stxmendez@gmail.com>
Miguel Molina <hi@mvader.me>
Mihai Borobocea <MihaiBorobocea@gmail.com> Mihai Borobocea <MihaiBorobocea@gmail.com>
Mikael Tillenius <mikti42@gmail.com> Mikael Tillenius <mikti42@gmail.com>
Mike Andrews <mra@xoba.com> Mike Andrews <mra@xoba.com>
@@ -737,7 +596,6 @@ Mikhail Panchenko <m@mihasya.com>
Miki Tebeka <miki.tebeka@gmail.com> Miki Tebeka <miki.tebeka@gmail.com>
Mikio Hara <mikioh.mikioh@gmail.com> Mikio Hara <mikioh.mikioh@gmail.com>
Mikkel Krautz <mikkel@krautz.dk> Mikkel Krautz <mikkel@krautz.dk>
Milutin Jovanović <jovanovic.milutin@gmail.com>
Miquel Sabaté Solà <mikisabate@gmail.com> Miquel Sabaté Solà <mikisabate@gmail.com>
Miroslav Genov <mgenov@gmail.com> Miroslav Genov <mgenov@gmail.com>
Mohit Agarwal <mohit@sdf.org> Mohit Agarwal <mohit@sdf.org>
@@ -747,57 +605,42 @@ Moov Corporation
Moriyoshi Koizumi <mozo@mozo.jp> Moriyoshi Koizumi <mozo@mozo.jp>
Morten Siebuhr <sbhr@sbhr.dk> Morten Siebuhr <sbhr@sbhr.dk>
Môshe van der Sterre <moshevds@gmail.com> Môshe van der Sterre <moshevds@gmail.com>
Mostyn Bramley-Moore <mostyn@antipode.se>
Muhammed Uluyol <uluyol0@gmail.com> Muhammed Uluyol <uluyol0@gmail.com>
Mura Li <mura_li@castech.com.tw>
Nan Deng <monnand@gmail.com> Nan Deng <monnand@gmail.com>
Nathan Caza <mastercactapus@gmail.com>
Nathan Humphreys <nkhumphreys@gmail.com>
Nathan John Youngman <nj@nathany.com> Nathan John Youngman <nj@nathany.com>
Nathan Otterness <otternes@cs.unc.edu> Nathan Otterness <otternes@cs.unc.edu>
Nathan P Finch <nate.finch@gmail.com> Nathan P Finch <nate.finch@gmail.com>
Nathan VanBenschoten <nvanbenschoten@gmail.com> Nathan VanBenschoten <nvanbenschoten@gmail.com>
Nathan Youngman <git@nathany.com> Nathan Youngman <git@nathany.com>
Nathaniel Cook <nvcook42@gmail.com>
Neelesh Chandola <neelesh.c98@gmail.com> Neelesh Chandola <neelesh.c98@gmail.com>
Neil Lyons <nwjlyons@googlemail.com>
Netflix, Inc. Netflix, Inc.
Neuman Vong <neuman.vong@gmail.com>
Nevins Bartolomeo <nevins.bartolomeo@gmail.com> Nevins Bartolomeo <nevins.bartolomeo@gmail.com>
Nexedi
ngmoco, LLC ngmoco, LLC
Niall Sheridan <nsheridan@gmail.com> Niall Sheridan <nsheridan@gmail.com>
Nic Day <nic.day@me.com> Nic Day <nic.day@me.com>
Nicholas Katsaros <nick@nickkatsaros.com> Nicholas Katsaros <nick@nickkatsaros.com>
Nicholas Maniscalco <nicholas@maniscalco.com>
Nicholas Presta <nick@nickpresta.ca> <nick1presta@gmail.com> Nicholas Presta <nick@nickpresta.ca> <nick1presta@gmail.com>
Nicholas Sullivan <nicholas.sullivan@gmail.com> Nicholas Sullivan <nicholas.sullivan@gmail.com>
Nicholas Waples <nwaples@gmail.com> Nicholas Waples <nwaples@gmail.com>
Nick Craig-Wood <nick@craig-wood.com> <nickcw@gmail.com> Nick Craig-Wood <nick@craig-wood.com> <nickcw@gmail.com>
Nick Leli <nicholasleli@gmail.com> Nick Leli <nicholasleli@gmail.com>
Nick Miyake <nmiyake@users.noreply.github.com>
Nick Patavalis <nick.patavalis@gmail.com> Nick Patavalis <nick.patavalis@gmail.com>
Nick Petroni <npetroni@cs.umd.edu> Nick Petroni <npetroni@cs.umd.edu>
Nick Robinson <nrobinson13@gmail.com>
Nicolas Kaiser <nikai@nikai.net> Nicolas Kaiser <nikai@nikai.net>
Nicolas Owens <mischief@offblast.org> Nicolas Owens <mischief@offblast.org>
Nicolas S. Dade <nic.dade@gmail.com> Nicolas S. Dade <nic.dade@gmail.com>
Niels Widger <niels.widger@gmail.com> Niels Widger <niels.widger@gmail.com>
Nigel Kerr <nigel.kerr@gmail.com> Nigel Kerr <nigel.kerr@gmail.com>
Nik Nyby <nnyby@columbia.edu> Nik Nyby <nnyby@columbia.edu>
Niklas Schnelle <niklas.schnelle@gmail.com>
Niko Dziemba <niko@dziemba.com> Niko Dziemba <niko@dziemba.com>
Nikolay Turpitko <nikolay@turpitko.com> Nikolay Turpitko <nikolay@turpitko.com>
Niranjan Godbole <niranjan8192@gmail.com>
Noah Campbell <noahcampbell@gmail.com> Noah Campbell <noahcampbell@gmail.com>
Norberto Lopes <nlopes.ml@gmail.com> Norberto Lopes <nlopes.ml@gmail.com>
Odin Ugedal <odin@ugedal.com> Odin Ugedal <odin@ugedal.com>
Oleg Bulatov <dmage@yandex-team.ru>
Oleg Vakheta <helginet@gmail.com> Oleg Vakheta <helginet@gmail.com>
Oleku Konko <oleku.konko@gmail.com> Oleku Konko <oleku.konko@gmail.com>
Oling Cat <olingcat@gmail.com> Oling Cat <olingcat@gmail.com>
Oliver Hookins <ohookins@gmail.com> Oliver Hookins <ohookins@gmail.com>
Oliver Tonnhofer <olt@bogosoft.com>
Olivier Antoine <olivier.antoine@gmail.com> Olivier Antoine <olivier.antoine@gmail.com>
Olivier Duperray <duperray.olivier@gmail.com> Olivier Duperray <duperray.olivier@gmail.com>
Olivier Poitrey <rs@dailymotion.com> Olivier Poitrey <rs@dailymotion.com>
@@ -805,29 +648,23 @@ Olivier Saingre <osaingre@gmail.com>
Oracle Oracle
Orange Orange
Özgür Kesim <oec-go@kesim.org> Özgür Kesim <oec-go@kesim.org>
Pablo Lalloni <plalloni@gmail.com>
Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
Padraig Kitterick <padraigkitterick@gmail.com> Padraig Kitterick <padraigkitterick@gmail.com>
Palm Stone Games Palm Stone Games
Paolo Giarrusso <p.giarrusso@gmail.com> Paolo Giarrusso <p.giarrusso@gmail.com>
Paolo Martini <mrtnpaolo@gmail.com> Paolo Martini <mrtnpaolo@gmail.com>
Parker Moore <parkrmoore@gmail.com> Parker Moore <parkrmoore@gmail.com>
Pascal S. de Kloe <pascal@quies.net> Pascal S. de Kloe <pascal@quies.net>
Pat Moroney <pat@pat.email>
Patrick Crosby <patrick@stathat.com> Patrick Crosby <patrick@stathat.com>
Patrick Gavlin <pgavlin@gmail.com> Patrick Gavlin <pgavlin@gmail.com>
Patrick Higgins <patrick.allen.higgins@gmail.com> Patrick Higgins <patrick.allen.higgins@gmail.com>
Patrick Lee <pattyshack101@gmail.com> Patrick Lee <pattyshack101@gmail.com>
Patrick Mézard <patrick@mezard.eu> Patrick Mézard <patrick@mezard.eu>
Patrick Mylund Nielsen <patrick@patrickmn.com> Patrick Mylund Nielsen <patrick@patrickmn.com>
Patrick Pelletier <pp.pelletier@gmail.com>
Patrick Smith <pat42smith@gmail.com> Patrick Smith <pat42smith@gmail.com>
Paul A Querna <paul.querna@gmail.com> Paul A Querna <paul.querna@gmail.com>
Paul Hammond <paul@paulhammond.org> Paul Hammond <paul@paulhammond.org>
Paul Jolly <paul@myitcv.org.uk>
Paul Lalonde <paul.a.lalonde@gmail.com> Paul Lalonde <paul.a.lalonde@gmail.com>
Paul Meyer <paul.meyer@microsoft.com> Paul Meyer <paul.meyer@microsoft.com>
Paul Querna <pquerna@apache.org>
Paul Rosania <paul.rosania@gmail.com> Paul Rosania <paul.rosania@gmail.com>
Paul Sbarra <Sbarra.Paul@gmail.com> Paul Sbarra <Sbarra.Paul@gmail.com>
Paul Smith <paulsmith@pobox.com> <paulsmith@gmail.com> Paul Smith <paulsmith@pobox.com> <paulsmith@gmail.com>
@@ -835,19 +672,15 @@ Paul van Brouwershaven <paul@vanbrouwershaven.com>
Paulo Casaretto <pcasaretto@gmail.com> Paulo Casaretto <pcasaretto@gmail.com>
Pavel Paulau <pavel.paulau@gmail.com> Pavel Paulau <pavel.paulau@gmail.com>
Pavel Zinovkin <pavel.zinovkin@gmail.com> Pavel Zinovkin <pavel.zinovkin@gmail.com>
Pavlo Sumkin <ymkins@gmail.com>
Pawel Knap <pawelknap88@gmail.com> Pawel Knap <pawelknap88@gmail.com>
Percy Wegmann <ox.to.a.cart@gmail.com> Percy Wegmann <ox.to.a.cart@gmail.com>
Perry Abbott <perry.j.abbott@gmail.com> Perry Abbott <perry.j.abbott@gmail.com>
Petar Maymounkov <petarm@gmail.com> Petar Maymounkov <petarm@gmail.com>
Peter Armitage <peter.armitage@gmail.com> Peter Armitage <peter.armitage@gmail.com>
Peter Bourgon <peter@bourgon.org>
Peter Froehlich <peter.hans.froehlich@gmail.com> Peter Froehlich <peter.hans.froehlich@gmail.com>
Peter Kleiweg <pkleiweg@xs4all.nl> Peter Kleiweg <pkleiweg@xs4all.nl>
Peter Moody <pmoody@uber.com> Peter Moody <pmoody@uber.com>
Peter Morjan <pmorjan@gmail.com>
Peter Mundy <go.peter.90@gmail.com> Peter Mundy <go.peter.90@gmail.com>
Peter Nguyen <peter@mictis.com>
Péter Surányi <speter.go1@gmail.com> Péter Surányi <speter.go1@gmail.com>
Péter Szilágyi <peterke@gmail.com> Péter Szilágyi <peterke@gmail.com>
Peter Waldschmidt <peter@waldschmidt.com> Peter Waldschmidt <peter@waldschmidt.com>
@@ -858,45 +691,34 @@ Philip Hofer <phofer@umich.edu>
Philip K. Warren <pkwarren@gmail.com> Philip K. Warren <pkwarren@gmail.com>
Pierre Durand <pierredurand@gmail.com> Pierre Durand <pierredurand@gmail.com>
Pierre Roullon <pierre.roullon@gmail.com> Pierre Roullon <pierre.roullon@gmail.com>
Piers <google@hellopiers.pro>
Pieter Droogendijk <pieter@binky.org.uk> Pieter Droogendijk <pieter@binky.org.uk>
Pietro Gagliardi <pietro10@mac.com> Pietro Gagliardi <pietro10@mac.com>
Prashant Varanasi <prashant@prashantv.com> Prashant Varanasi <prashant@prashantv.com>
Pravendra Singh <hackpravj@gmail.com>
Preetam Jinka <pj@preet.am> Preetam Jinka <pj@preet.am>
Qiuxuan Zhu <ilsh1022@gmail.com>
Quan Tran <qeed.quan@gmail.com> Quan Tran <qeed.quan@gmail.com>
Quan Yong Zhai <qyzhai@gmail.com> Quan Yong Zhai <qyzhai@gmail.com>
Quentin Perez <qperez@ocs.online.net> Quentin Perez <qperez@ocs.online.net>
Quentin Renard <contact@asticode.com>
Quoc-Viet Nguyen <afelion@gmail.com> Quoc-Viet Nguyen <afelion@gmail.com>
RackTop Systems Inc. RackTop Systems Inc.
Radu Berinde <radu@cockroachlabs.com> Radu Berinde <radu@cockroachlabs.com>
Rafal Jeczalik <rjeczalik@gmail.com> Rafal Jeczalik <rjeczalik@gmail.com>
Raif S. Naffah <go@naffah-raif.name> Raif S. Naffah <go@naffah-raif.name>
RainTank
Rajat Goel <rajat.goel2010@gmail.com> Rajat Goel <rajat.goel2010@gmail.com>
Ralph Corderoy <ralph@inputplus.co.uk> Ralph Corderoy <ralph@inputplus.co.uk>
Raphael Geronimi <raphael.geronimi@gmail.com> Raphael Geronimi <raphael.geronimi@gmail.com>
Ray Tung <rtung@thoughtworks.com>
Raymond Kazlauskas <raima220@gmail.com>
Red Hat, Inc. Red Hat, Inc.
Reinaldo de Souza Jr <juniorz@gmail.com> Reinaldo de Souza Jr <juniorz@gmail.com>
Remi Gillig <remigillig@gmail.com>
Rémy Oudompheng <oudomphe@phare.normalesup.org> Rémy Oudompheng <oudomphe@phare.normalesup.org>
Ricardo Padilha <ricardospadilha@gmail.com> Ricardo Padilha <ricardospadilha@gmail.com>
Richard Barnes <rlb@ipv.sx> Richard Barnes <rlb@ipv.sx>
Richard Crowley <r@rcrowley.org> Richard Crowley <r@rcrowley.org>
Richard Dingwall <rdingwall@gmail.com>
Richard Eric Gavaletz <gavaletz@gmail.com> Richard Eric Gavaletz <gavaletz@gmail.com>
Richard Gibson <richard.gibson@gmail.com> Richard Gibson <richard.gibson@gmail.com>
Richard Miller <miller.research@gmail.com> Richard Miller <miller.research@gmail.com>
Richard Musiol <mail@richard-musiol.de> Richard Musiol <mail@richard-musiol.de>
Rick Arnold <rickarnoldjr@gmail.com> Rick Arnold <rickarnoldjr@gmail.com>
Rick Sayre <whorfin@gmail.com>
Risto Jaakko Saarelma <rsaarelm@gmail.com> Risto Jaakko Saarelma <rsaarelm@gmail.com>
Rob Norman <rob.norman@infinitycloud.com> Rob Norman <rob.norman@infinitycloud.com>
Rob Phoenix <rob@robphoenix.com>
Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au> Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au>
Robert Dinu <r@varp.se> Robert Dinu <r@varp.se>
Robert Figueiredo <robfig@gmail.com> Robert Figueiredo <robfig@gmail.com>
@@ -915,21 +737,17 @@ Ross Light <rlight2@gmail.com>
Rowan Worth <sqweek@gmail.com> Rowan Worth <sqweek@gmail.com>
Russell Haering <russellhaering@gmail.com> Russell Haering <russellhaering@gmail.com>
Ryan Bagwell <ryanbagwell@outlook.com> Ryan Bagwell <ryanbagwell@outlook.com>
Ryan Boehning <ryan.boehning@apcera.com>
Ryan Hitchman <hitchmanr@gmail.com> Ryan Hitchman <hitchmanr@gmail.com>
Ryan Lower <rpjlower@gmail.com> Ryan Lower <rpjlower@gmail.com>
Ryan Seys <ryan@ryanseys.com> Ryan Seys <ryan@ryanseys.com>
Ryan Slade <ryanslade@gmail.com> Ryan Slade <ryanslade@gmail.com>
Ryuzo Yamamoto <ryuzo.yamamoto@gmail.com> Ryuzo Yamamoto <ryuzo.yamamoto@gmail.com>
S.Çağlar Onur <caglar@10ur.org> S.Çağlar Onur <caglar@10ur.org>
Sakeven Jiang <jc5930@sina.cn>
Salmān Aljammāz <s@0x65.net> Salmān Aljammāz <s@0x65.net>
Sam Boyer <tech@samboyer.org>
Sam Hug <samuel.b.hug@gmail.com> Sam Hug <samuel.b.hug@gmail.com>
Sam Whited <sam@samwhited.com> Sam Whited <sam@samwhited.com>
Samuele Pedroni <pedronis@lucediurna.net> Samuele Pedroni <pedronis@lucediurna.net>
Sanjay Menakuru <balasanjay@gmail.com> Sanjay Menakuru <balasanjay@gmail.com>
Sascha Brawer <sascha@brawer.ch>
Sasha Sobol <sasha@scaledinference.com> Sasha Sobol <sasha@scaledinference.com>
Scott Barron <scott.barron@github.com> Scott Barron <scott.barron@github.com>
Scott Bell <scott@sctsm.com> Scott Bell <scott@sctsm.com>
@@ -940,7 +758,6 @@ Sebastien Binet <seb.binet@gmail.com>
Sébastien Paolacci <sebastien.paolacci@gmail.com> Sébastien Paolacci <sebastien.paolacci@gmail.com>
Sergei Skorobogatov <skorobo@rambler.ru> Sergei Skorobogatov <skorobo@rambler.ru>
Sergey 'SnakE' Gromov <snake.scaly@gmail.com> Sergey 'SnakE' Gromov <snake.scaly@gmail.com>
Sergey Mishin <sergeymishine@gmail.com>
Sergio Luis O. B. Correia <sergio@correia.cc> Sergio Luis O. B. Correia <sergio@correia.cc>
Seth Hoenig <seth.a.hoenig@gmail.com> Seth Hoenig <seth.a.hoenig@gmail.com>
Seth Vargo <sethvargo@gmail.com> Seth Vargo <sethvargo@gmail.com>
@@ -949,9 +766,7 @@ Shane Hansen <shanemhansen@gmail.com>
Shaozhen Ding <dsz0111@gmail.com> Shaozhen Ding <dsz0111@gmail.com>
Shawn Smith <shawn.p.smith@gmail.com> Shawn Smith <shawn.p.smith@gmail.com>
Shenghou Ma <minux.ma@gmail.com> Shenghou Ma <minux.ma@gmail.com>
Shi Han Ng <shihanng@gmail.com>
Shinji Tanaka <shinji.tanaka@gmail.com> Shinji Tanaka <shinji.tanaka@gmail.com>
Shintaro Kaneko <kaneshin0120@gmail.com>
Shivakumar GN <shivakumar.gn@gmail.com> Shivakumar GN <shivakumar.gn@gmail.com>
Silvan Jegen <s.jegen@gmail.com> Silvan Jegen <s.jegen@gmail.com>
Simon Jefford <simon.jefford@gmail.com> Simon Jefford <simon.jefford@gmail.com>
@@ -971,17 +786,13 @@ Stan Schwertly <stan@schwertly.com>
Stefan Nilsson <snilsson@nada.kth.se> <trolleriprofessorn@gmail.com> Stefan Nilsson <snilsson@nada.kth.se> <trolleriprofessorn@gmail.com>
Stéphane Travostino <stephane.travostino@gmail.com> Stéphane Travostino <stephane.travostino@gmail.com>
Stephen McQuay <stephen@mcquay.me> Stephen McQuay <stephen@mcquay.me>
Stephen Searles <stephens2424@gmail.com>
Stephen Weinberg <stephen@q5comm.com> Stephen Weinberg <stephen@q5comm.com>
Steve McCoy <mccoyst@gmail.com> Steve McCoy <mccoyst@gmail.com>
Steve Phillips <elimisteve@gmail.com> Steve Phillips <elimisteve@gmail.com>
Steve Streeting <steve@stevestreeting.com> Steve Streeting <steve@stevestreeting.com>
Steven Elliot Harris <seharris@gmail.com> Steven Elliot Harris <seharris@gmail.com>
Steven Erenst <stevenerenst@gmail.com>
Steven Hartland <steven.hartland@multiplay.co.uk> Steven Hartland <steven.hartland@multiplay.co.uk>
Steven Wilkin <stevenwilkin@gmail.com>
Stripe, Inc. Stripe, Inc.
Sunny <me@darkowlzz.space>
Suyash <dextrous93@gmail.com> Suyash <dextrous93@gmail.com>
Sven Almgren <sven@tras.se> Sven Almgren <sven@tras.se>
Syohei YOSHIDA <syohex@gmail.com> Syohei YOSHIDA <syohex@gmail.com>
@@ -993,17 +804,12 @@ Takuya Ueda <uedatakuya@gmail.com>
Tal Shprecher <tshprecher@gmail.com> Tal Shprecher <tshprecher@gmail.com>
Tamir Duberstein <tamird@gmail.com> Tamir Duberstein <tamird@gmail.com>
Tarmigan Casebolt <tarmigan@gmail.com> Tarmigan Casebolt <tarmigan@gmail.com>
Taro Aoki <aizu.s1230022@gmail.com>
Taru Karttunen <taruti@taruti.net> Taru Karttunen <taruti@taruti.net>
Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Ted Kornish <golang@tedkornish.com>
Teleport Inc.
Terrel Shumway <gopher@shumway.us> Terrel Shumway <gopher@shumway.us>
Tetsuo Kiso <tetsuokiso9@gmail.com> Tetsuo Kiso <tetsuokiso9@gmail.com>
Thanatat Tamtan <acoshift@gmail.com>
Thiago Fransosi Farina <thiago.farina@gmail.com> Thiago Fransosi Farina <thiago.farina@gmail.com>
Thomas Alan Copeland <talan.copeland@gmail.com> Thomas Alan Copeland <talan.copeland@gmail.com>
Thomas Bonfort <thomas.bonfort@gmail.com>
Thomas de Zeeuw <thomasdezeeuw@gmail.com> Thomas de Zeeuw <thomasdezeeuw@gmail.com>
Thomas Desrosiers <thomasdesr@gmail.com> Thomas Desrosiers <thomasdesr@gmail.com>
Thomas Kappler <tkappler@gmail.com> Thomas Kappler <tkappler@gmail.com>
@@ -1012,30 +818,23 @@ Thordur Bjornsson <thorduri@secnorth.net>
Tilman Dilo <tilman.dilo@gmail.com> Tilman Dilo <tilman.dilo@gmail.com>
Tim Cooijmans <timcooijmans@gmail.com> Tim Cooijmans <timcooijmans@gmail.com>
Tim Ebringer <tim.ebringer@gmail.com> Tim Ebringer <tim.ebringer@gmail.com>
Tim Heckman <t@heckman.io>
Tim Henderson <tim.tadh@gmail.com> Tim Henderson <tim.tadh@gmail.com>
Timo Savola <timo.savola@gmail.com> Timo Savola <timo.savola@gmail.com>
Timo Truyts <alkaloid.btx@gmail.com> Timo Truyts <alkaloid.btx@gmail.com>
Timothy Studd <tim@timstudd.com> Timothy Studd <tim@timstudd.com>
Tobias Columbus <tobias.columbus@gmail.com> Tobias Columbus <tobias.columbus@gmail.com>
Tobias Klauser <tklauser@distanz.ch>
Todd Neal <todd@tneal.org> Todd Neal <todd@tneal.org>
Tom Heng <zhm20070928@gmail.com> Tom Heng <zhm20070928@gmail.com>
Tom Linford <tomlinford@gmail.com> Tom Linford <tomlinford@gmail.com>
Tommy Schaefer <tommy.schaefer@teecom.com> Tommy Schaefer <tommy.schaefer@teecom.com>
Tonis Tiigi <tonistiigi@gmail.com>
Tony Walker <walkert.uk@gmail.com>
Tor Andersson <tor.andersson@gmail.com> Tor Andersson <tor.andersson@gmail.com>
Tormod Erevik Lea <tormodlea@gmail.com> Tormod Erevik Lea <tormodlea@gmail.com>
Toshiki Shima <hayabusa1419@gmail.com>
Totoro W <tw19881113@gmail.com> Totoro W <tw19881113@gmail.com>
Travis Cline <travis.cline@gmail.com> Travis Cline <travis.cline@gmail.com>
Trey Lawrence <lawrence.trey@gmail.com> Trey Lawrence <lawrence.trey@gmail.com>
Trey Roessig <trey.roessig@gmail.com>
Trey Tacon <ttacon@gmail.com> Trey Tacon <ttacon@gmail.com>
Tristan Colgate <tcolgate@gmail.com> Tristan Colgate <tcolgate@gmail.com>
Tristan Ooohry <ooohry@gmail.com> Tristan Ooohry <ooohry@gmail.com>
Trung Nguyen <trung.n.k@gmail.com>
Tudor Golubenco <tudor.g@gmail.com> Tudor Golubenco <tudor.g@gmail.com>
Tuo Shan <sturbo89@gmail.com> Tuo Shan <sturbo89@gmail.com>
Tyler Bunnell <tylerbunnell@gmail.com> Tyler Bunnell <tylerbunnell@gmail.com>
@@ -1048,7 +847,6 @@ Uriel Mangado <uriel@berlinblue.org>
Vadim Grek <vadimprog@gmail.com> Vadim Grek <vadimprog@gmail.com>
Vadim Vygonets <unixdj@gmail.com> Vadim Vygonets <unixdj@gmail.com>
Vendasta Vendasta
Victor Vrantchan <vrancean+github@gmail.com>
Vincent Ambo <tazjin@googlemail.com> Vincent Ambo <tazjin@googlemail.com>
Vincent Batts <vbatts@hashbangbash.com> <vbatts@gmail.com> Vincent Batts <vbatts@hashbangbash.com> <vbatts@gmail.com>
Vincent Vanackere <vincent.vanackere@gmail.com> Vincent Vanackere <vincent.vanackere@gmail.com>
@@ -1058,31 +856,22 @@ Vitor De Mario <vitordemario@gmail.com>
Vladimir Mihailenco <vladimir.webdev@gmail.com> Vladimir Mihailenco <vladimir.webdev@gmail.com>
Vladimir Nikishenko <vova616@gmail.com> Vladimir Nikishenko <vova616@gmail.com>
Vladimir Stefanovic <vladimir.stefanovic@imgtec.com> Vladimir Stefanovic <vladimir.stefanovic@imgtec.com>
Vladimir Varankin <nek.narqo@gmail.com>
Volker Dobler <dr.volker.dobler@gmail.com> Volker Dobler <dr.volker.dobler@gmail.com>
Wade Simmons <wade@wades.im>
Wander Lairson Costa <wcosta@mozilla.com>
Weaveworks Weaveworks
Wei Guangjing <vcc.163@gmail.com> Wei Guangjing <vcc.163@gmail.com>
Weichao Tang <tevic.tt@gmail.com>
Will Storey <will@summercat.com>
Willem van der Schyff <willemvds@gmail.com> Willem van der Schyff <willemvds@gmail.com>
William Josephson <wjosephson@gmail.com> William Josephson <wjosephson@gmail.com>
William Orr <will@worrbase.com> <ay1244@gmail.com> William Orr <will@worrbase.com> <ay1244@gmail.com>
Wisdom Omuya <deafgoat@gmail.com> Wisdom Omuya <deafgoat@gmail.com>
Wu Yunzhou <yunzhouwu@gmail.com>
Xia Bin <snyh@snyh.org> Xia Bin <snyh@snyh.org>
Xing Xing <mikespook@gmail.com> Xing Xing <mikespook@gmail.com>
Xu Fei <badgangkiller@gmail.com>
Xudong Zhang <felixmelon@gmail.com> Xudong Zhang <felixmelon@gmail.com>
Xuyang Kang <xuyangkang@gmail.com> Xuyang Kang <xuyangkang@gmail.com>
Yahoo Inc. Yahoo Inc.
Yann Kerhervé <yann.kerherve@gmail.com> Yann Kerhervé <yann.kerherve@gmail.com>
Yao Zhang <lunaria21@gmail.com> Yao Zhang <lunaria21@gmail.com>
Yasha Bubnov <girokompass@gmail.com>
Yasuharu Goto <matope.ono@gmail.com> Yasuharu Goto <matope.ono@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com> Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yestin Sun <ylh@pdx.edu>
Yesudeep Mangalapilly <yesudeep@google.com> Yesudeep Mangalapilly <yesudeep@google.com>
Yissakhar Z. Beck <yissakhar.beck@gmail.com> Yissakhar Z. Beck <yissakhar.beck@gmail.com>
Yo-An Lin <yoanlin93@gmail.com> Yo-An Lin <yoanlin93@gmail.com>
@@ -1093,15 +882,9 @@ Yusuke Kagiwada <block.rxckin.beats@gmail.com>
Yuusei Kuwana <kuwana@kumama.org> Yuusei Kuwana <kuwana@kumama.org>
Yuval Pavel Zholkover <paulzhol@gmail.com> Yuval Pavel Zholkover <paulzhol@gmail.com>
Zac Bergquist <zbergquist99@gmail.com> Zac Bergquist <zbergquist99@gmail.com>
Zach Bintliff <zbintliff@gmail.com>
Zak <zrjknill@gmail.com>
Zakatell Kanda <hi@zkanda.io>
Zellyn Hunter <zellyn@gmail.com>
Zemanta d.o.o. Zemanta d.o.o.
Zev Goldstein <zev.goldstein@gmail.com> Zev Goldstein <zev.goldstein@gmail.com>
Ziad Hatahet <hatahet@gmail.com> Ziad Hatahet <hatahet@gmail.com>
Zorion Arrizabalaga <zorionk@gmail.com> Zorion Arrizabalaga <zorionk@gmail.com>
Максим Федосеев <max.faceless.frei@gmail.com>
Фахриддин Балтаев <faxriddinjon@gmail.com> Фахриддин Балтаев <faxriddinjon@gmail.com>
张嵩 <zs349596@gmail.com>
申习之 <bronze1man@gmail.com> 申习之 <bronze1man@gmail.com>

View File

@@ -4,19 +4,15 @@ Go is an open source project.
It is the work of hundreds of contributors. We appreciate your help! It is the work of hundreds of contributors. We appreciate your help!
## Before filing an issue
If you are unsure whether you have found a bug, please consider asking in the [golang-nuts mailing
list](https://groups.google.com/forum/#!forum/golang-nuts) or [other forums](https://golang.org/help/) first. If
the behavior you are seeing is confirmed as a bug or issue, it can easily be re-raised in the issue tracker.
## Filing issues ## Filing issues
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org). General questions should go to the
See the [security policy](https://golang.org/security) for details. [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) or
[other forum](https://golang.org/wiki/Questions) instead of the issue tracker.
The gophers there will answer or ask you to file an issue if you've tripped over a bug.
The recommended way to file an issue is by running `go bug`. When filing an issue, make sure to answer these five questions:
Otherwise, when filing an issue, make sure to answer these five questions:
1. What version of Go are you using (`go version`)? 1. What version of Go are you using (`go version`)?
2. What operating system and processor architecture are you using? 2. What operating system and processor architecture are you using?
@@ -26,9 +22,12 @@ Otherwise, when filing an issue, make sure to answer these five questions:
For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/). For change proposals, see [Proposing Changes To Go](https://github.com/golang/proposal/).
Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org).
## Contributing code ## Contributing code
Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches. Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
before sending patches.
**We do not accept GitHub pull requests** **We do not accept GitHub pull requests**
(we use [an instance](https://go-review.googlesource.com/) of the (we use [an instance](https://go-review.googlesource.com/) of the

File diff suppressed because it is too large Load Diff

View File

@@ -4,42 +4,40 @@ Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software. reliable, and efficient software.
![Gopher image](doc/gopher/fiveyears.jpg) ![Gopher image](doc/gopher/fiveyears.jpg)
*Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].*
For documentation about how to install and use Go,
visit https://golang.org/ or load doc/install-source.html
in your web browser.
Our canonical Git repository is located at https://go.googlesource.com/go. Our canonical Git repository is located at https://go.googlesource.com/go.
There is a mirror of the repository at https://github.com/golang/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the
BSD-style license found in the LICENSE file.
### Download and Install
#### Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install
or load doc/install.html in your web browser for installation
instructions.
#### Install From Source
If a binary distribution is not available for your combination of
operating system and architecture, visit
https://golang.org/doc/install/source or load doc/install-source.html
in your web browser for source installation instructions.
### Contributing
Go is the work of hundreds of contributors. We appreciate your help! Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: To contribute, please read the contribution guidelines:
https://golang.org/doc/contribute.html https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that ##### Note that we do not accept pull requests and that we use the issue tracker for bug reports and proposals only. Please ask questions on https://forum.golangbridge.org or https://groups.google.com/forum/#!forum/golang-nuts.
we use the issue tracker for bug reports and proposals only. See
https://golang.org/wiki/Questions for a list of places to ask
questions about the Go language.
[rf]: https://reneefrench.blogspot.com/ Unless otherwise noted, the Go source files are distributed
[cc3-by]: https://creativecommons.org/licenses/by/3.0/ under the BSD-style license found in the LICENSE file.
--
## Binary Distribution Notes
If you have just untarred a binary Go distribution, you need to set
the environment variable $GOROOT to the full path of the go
directory (the one containing this file). You can omit the
variable if you unpack it into /usr/local/go, or if you rebuild
from sources by running all.bash (see doc/install-source.html).
You should also add the Go binary directory $GOROOT/bin
to your shell's path.
For example, if you extracted the tar file into $HOME/go, you might
put the following in your .profile:
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
See https://golang.org/doc/install or doc/install.html for more details.

View File

@@ -1,5 +1,4 @@
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error) pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
pkg math/big, type Word uintptr
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error) pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
pkg os (linux-arm), const O_SYNC = 4096 pkg os (linux-arm), const O_SYNC = 4096
pkg os (linux-arm-cgo), const O_SYNC = 4096 pkg os (linux-arm-cgo), const O_SYNC = 4096

View File

@@ -1,169 +0,0 @@
pkg crypto, const BLAKE2b_256 = 17
pkg crypto, const BLAKE2b_256 Hash
pkg crypto, const BLAKE2b_384 = 18
pkg crypto, const BLAKE2b_384 Hash
pkg crypto, const BLAKE2b_512 = 19
pkg crypto, const BLAKE2b_512 Hash
pkg crypto, const BLAKE2s_256 = 16
pkg crypto, const BLAKE2s_256 Hash
pkg crypto/x509, type Certificate struct, ExcludedDNSDomains []string
pkg database/sql, method (*Conn) BeginTx(context.Context, *TxOptions) (*Tx, error)
pkg database/sql, method (*Conn) Close() error
pkg database/sql, method (*Conn) ExecContext(context.Context, string, ...interface{}) (Result, error)
pkg database/sql, method (*Conn) PingContext(context.Context) error
pkg database/sql, method (*Conn) PrepareContext(context.Context, string) (*Stmt, error)
pkg database/sql, method (*Conn) QueryContext(context.Context, string, ...interface{}) (*Rows, error)
pkg database/sql, method (*Conn) QueryRowContext(context.Context, string, ...interface{}) *Row
pkg database/sql, method (*DB) Conn(context.Context) (*Conn, error)
pkg database/sql, type Conn struct
pkg database/sql, type Out struct
pkg database/sql, type Out struct, Dest interface{}
pkg database/sql, type Out struct, In bool
pkg database/sql, var ErrConnDone error
pkg database/sql/driver, type NamedValueChecker interface { CheckNamedValue }
pkg database/sql/driver, type NamedValueChecker interface, CheckNamedValue(*NamedValue) error
pkg database/sql/driver, var ErrRemoveArgument error
pkg encoding/asn1, const TagNull = 5
pkg encoding/asn1, const TagNull ideal-int
pkg encoding/asn1, var NullBytes []uint8
pkg encoding/asn1, var NullRawValue RawValue
pkg encoding/base32, const NoPadding = -1
pkg encoding/base32, const NoPadding int32
pkg encoding/base32, const StdPadding = 61
pkg encoding/base32, const StdPadding int32
pkg encoding/base32, method (Encoding) WithPadding(int32) *Encoding
pkg encoding/csv, type Reader struct, ReuseRecord bool
pkg encoding/json, func Valid([]uint8) bool
pkg go/ast, type TypeSpec struct, Assign token.Pos
pkg go/types, func SizesFor(string, string) Sizes
pkg go/types, method (*TypeName) IsAlias() bool
pkg hash/fnv, func New128() hash.Hash
pkg hash/fnv, func New128a() hash.Hash
pkg html/template, const ErrPredefinedEscaper = 11
pkg html/template, const ErrPredefinedEscaper ErrorCode
pkg image/png, type Encoder struct, BufferPool EncoderBufferPool
pkg image/png, type EncoderBuffer struct
pkg image/png, type EncoderBufferPool interface { Get, Put }
pkg image/png, type EncoderBufferPool interface, Get() *EncoderBuffer
pkg image/png, type EncoderBufferPool interface, Put(*EncoderBuffer)
pkg math/big, method (*Int) IsInt64() bool
pkg math/big, method (*Int) IsUint64() bool
pkg math/big, type Word uint
pkg math/bits, const UintSize = 64
pkg math/bits, const UintSize ideal-int
pkg math/bits, func LeadingZeros(uint) int
pkg math/bits, func LeadingZeros16(uint16) int
pkg math/bits, func LeadingZeros32(uint32) int
pkg math/bits, func LeadingZeros64(uint64) int
pkg math/bits, func LeadingZeros8(uint8) int
pkg math/bits, func Len(uint) int
pkg math/bits, func Len16(uint16) int
pkg math/bits, func Len32(uint32) int
pkg math/bits, func Len64(uint64) int
pkg math/bits, func Len8(uint8) int
pkg math/bits, func OnesCount(uint) int
pkg math/bits, func OnesCount16(uint16) int
pkg math/bits, func OnesCount32(uint32) int
pkg math/bits, func OnesCount64(uint64) int
pkg math/bits, func OnesCount8(uint8) int
pkg math/bits, func Reverse(uint) uint
pkg math/bits, func Reverse16(uint16) uint16
pkg math/bits, func Reverse32(uint32) uint32
pkg math/bits, func Reverse64(uint64) uint64
pkg math/bits, func Reverse8(uint8) uint8
pkg math/bits, func ReverseBytes(uint) uint
pkg math/bits, func ReverseBytes16(uint16) uint16
pkg math/bits, func ReverseBytes32(uint32) uint32
pkg math/bits, func ReverseBytes64(uint64) uint64
pkg math/bits, func RotateLeft(uint, int) uint
pkg math/bits, func RotateLeft16(uint16, int) uint16
pkg math/bits, func RotateLeft32(uint32, int) uint32
pkg math/bits, func RotateLeft64(uint64, int) uint64
pkg math/bits, func RotateLeft8(uint8, int) uint8
pkg math/bits, func TrailingZeros(uint) int
pkg math/bits, func TrailingZeros16(uint16) int
pkg math/bits, func TrailingZeros32(uint32) int
pkg math/bits, func TrailingZeros64(uint64) int
pkg math/bits, func TrailingZeros8(uint8) int
pkg mime, var ErrInvalidMediaParameter error
pkg mime/multipart, type FileHeader struct, Size int64
pkg mime/multipart, var ErrMessageTooLarge error
pkg net, method (*IPConn) SyscallConn() (syscall.RawConn, error)
pkg net, method (*TCPConn) SyscallConn() (syscall.RawConn, error)
pkg net, method (*UDPConn) SyscallConn() (syscall.RawConn, error)
pkg net, method (*UnixConn) SyscallConn() (syscall.RawConn, error)
pkg net, type Resolver struct, Dial func(context.Context, string, string) (Conn, error)
pkg net, type Resolver struct, StrictErrors bool
pkg net/http, func ServeTLS(net.Listener, Handler, string, string) error
pkg net/http, method (*Server) RegisterOnShutdown(func())
pkg net/http, method (*Server) ServeTLS(net.Listener, string, string) error
pkg net/http/fcgi, func ProcessEnv(*http.Request) map[string]string
pkg net/http/httptest, method (*Server) Certificate() *x509.Certificate
pkg net/http/httptest, method (*Server) Client() *http.Client
pkg reflect, func MakeMapWithSize(Type, int) Value
pkg runtime/pprof, func Do(context.Context, LabelSet, func(context.Context))
pkg runtime/pprof, func ForLabels(context.Context, func(string, string) bool)
pkg runtime/pprof, func Label(context.Context, string) (string, bool)
pkg runtime/pprof, func Labels(...string) LabelSet
pkg runtime/pprof, func SetGoroutineLabels(context.Context)
pkg runtime/pprof, func WithLabels(context.Context, LabelSet) context.Context
pkg runtime/pprof, type LabelSet struct
pkg sync, method (*Map) Delete(interface{})
pkg sync, method (*Map) Load(interface{}) (interface{}, bool)
pkg sync, method (*Map) LoadOrStore(interface{}, interface{}) (interface{}, bool)
pkg sync, method (*Map) Range(func(interface{}, interface{}) bool)
pkg sync, method (*Map) Store(interface{}, interface{})
pkg sync, type Map struct
pkg syscall (darwin-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (darwin-386), type Credential struct, NoSetGroups bool
pkg syscall (darwin-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (darwin-amd64), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-386-cgo), func Pipe2([]int, int) error
pkg syscall (freebsd-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-386), func Pipe2([]int, int) error
pkg syscall (freebsd-386), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-amd64-cgo), func Pipe2([]int, int) error
pkg syscall (freebsd-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-amd64), func Pipe2([]int, int) error
pkg syscall (freebsd-amd64), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-arm-cgo), func Pipe2([]int, int) error
pkg syscall (freebsd-arm-cgo), type Credential struct, NoSetGroups bool
pkg syscall (freebsd-arm), func Pipe2([]int, int) error
pkg syscall (freebsd-arm), type Credential struct, NoSetGroups bool
pkg syscall (linux-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (linux-386-cgo), type SysProcAttr struct, AmbientCaps []uintptr
pkg syscall (linux-386), type Credential struct, NoSetGroups bool
pkg syscall (linux-386), type SysProcAttr struct, AmbientCaps []uintptr
pkg syscall (linux-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (linux-amd64-cgo), type SysProcAttr struct, AmbientCaps []uintptr
pkg syscall (linux-amd64), type Credential struct, NoSetGroups bool
pkg syscall (linux-amd64), type SysProcAttr struct, AmbientCaps []uintptr
pkg syscall (linux-arm-cgo), type Credential struct, NoSetGroups bool
pkg syscall (linux-arm-cgo), type SysProcAttr struct, AmbientCaps []uintptr
pkg syscall (linux-arm), type Credential struct, NoSetGroups bool
pkg syscall (linux-arm), type SysProcAttr struct, AmbientCaps []uintptr
pkg syscall (netbsd-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-386), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-amd64), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-arm-cgo), type Credential struct, NoSetGroups bool
pkg syscall (netbsd-arm), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-386-cgo), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-386), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-amd64-cgo), type Credential struct, NoSetGroups bool
pkg syscall (openbsd-amd64), type Credential struct, NoSetGroups bool
pkg syscall (windows-386), const WSAECONNABORTED = 10053
pkg syscall (windows-386), const WSAECONNABORTED Errno
pkg syscall (windows-amd64), const WSAECONNABORTED = 10053
pkg syscall (windows-amd64), const WSAECONNABORTED Errno
pkg syscall, type Conn interface { SyscallConn }
pkg syscall, type Conn interface, SyscallConn() (RawConn, error)
pkg syscall, type RawConn interface { Control, Read, Write }
pkg syscall, type RawConn interface, Control(func(uintptr)) error
pkg syscall, type RawConn interface, Read(func(uintptr) bool) error
pkg syscall, type RawConn interface, Write(func(uintptr) bool) error
pkg testing, method (*B) Helper()
pkg testing, method (*T) Helper()
pkg testing, type TB interface, Helper()
pkg time, method (Duration) Round(Duration) Duration
pkg time, method (Duration) Truncate(Duration) Duration

View File

@@ -20,7 +20,7 @@ trap cleanup 0 INT
rm -f get.bin final-test.bin a.out rm -f get.bin final-test.bin a.out
# If called with -all, check that all code snippets compile. # If called with -all, check that all code snippets compile.
if [ "$1" = "-all" ]; then if [ "$1" == "-all" ]; then
for fn in *.go; do for fn in *.go; do
go build -o a.out $fn go build -o a.out $fn
done done

View File

@@ -22,7 +22,7 @@ using the go <code>tool</code> subcommand, such as <code>go tool vet</code>.
This style of invocation allows, for instance, checking a single source file This style of invocation allows, for instance, checking a single source file
rather than an entire package: <code>go tool vet myprogram.go</code> as rather than an entire package: <code>go tool vet myprogram.go</code> as
compared to <code>go vet mypackage</code>. compared to <code>go vet mypackage</code>.
Some of the commands, such as <code>pprof</code>, are accessible only through Some of the commands, such as <code>yacc</code>, are accessible only through
the go <code>tool</code> subcommand. the go <code>tool</code> subcommand.
</p> </p>
@@ -62,7 +62,7 @@ details.
</tr> </tr>
<tr> <tr>
<td><a href="/cmd/cover/">cover</a></td> <td><a href="//godoc.org/golang.org/x/tools/cmd/cover/">cover</a></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Cover is a program for creating and analyzing the coverage profiles <td>Cover is a program for creating and analyzing the coverage profiles
generated by <code>"go test -coverprofile"</code>.</td> generated by <code>"go test -coverprofile"</code>.</td>
@@ -95,6 +95,12 @@ gofmt</a> command with more general options.</td>
calls whose arguments do not align with the format string.</td> calls whose arguments do not align with the format string.</td>
</tr> </tr>
<tr>
<td><a href="/cmd/yacc/">yacc</a></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>Yacc is a version of yacc that generates parsers implemented in Go.</td>
</tr>
</table> </table>
<p> <p>

View File

@@ -124,12 +124,8 @@ workspace. It defaults to a directory named <code>go</code> inside your home dir
so <code>$HOME/go</code> on Unix, so <code>$HOME/go</code> on Unix,
<code>$home/go</code> on Plan 9, <code>$home/go</code> on Plan 9,
and <code>%USERPROFILE%\go</code> (usually <code>C:\Users\YourName\go</code>) on Windows. and <code>%USERPROFILE%\go</code> (usually <code>C:\Users\YourName\go</code>) on Windows.
</p> If you would like to work in a different location, you will need to set
<code>GOPATH</code> to the path to that directory.
<p>
If you would like to work in a different location, you will need to
<a href="https://golang.org/wiki/SettingGOPATH">set <code>GOPATH</code></a>
to the path to that directory.
(Another common setup is to set <code>GOPATH=$HOME</code>.) (Another common setup is to set <code>GOPATH=$HOME</code>.)
Note that <code>GOPATH</code> must <b>not</b> be the Note that <code>GOPATH</code> must <b>not</b> be the
same path as your Go installation. same path as your Go installation.
@@ -270,7 +266,7 @@ This command builds the <code>hello</code> command, producing an executable
binary. It then installs that binary to the workspace's <code>bin</code> binary. It then installs that binary to the workspace's <code>bin</code>
directory as <code>hello</code> (or, under Windows, <code>hello.exe</code>). directory as <code>hello</code> (or, under Windows, <code>hello.exe</code>).
In our example, that will be <code>$GOPATH/bin/hello</code>, which is In our example, that will be <code>$GOPATH/bin/hello</code>, which is
<code>$HOME/go/bin/hello</code>. <code>$HOME/work/bin/hello</code>.
</p> </p>
<p> <p>

View File

@@ -148,26 +148,29 @@ These actions are explicitly forbidden in Go spaces:
<p> <p>
The Go spaces are not free speech venues; they are for discussion about Go. The Go spaces are not free speech venues; they are for discussion about Go.
Each of these spaces have their own moderators. These spaces have moderators.
The goal of the moderators is to facilitate civil discussion about Go.
</p> </p>
<p> <p>
When using the official Go spaces you should act in the spirit of the “Gopher When using the official Go spaces you should act in the spirit of the “Gopher
values”. values”.
If a reported conflict cannot be resolved amicably, the CoC Working Group If you conduct yourself in a way that is explicitly forbidden by the CoC,
may make a recommendation to the relevant forum moderators. you will be warned and asked to stop.
If you do not stop, you will be removed from our community spaces temporarily.
Repeated, willful breaches of the CoC will result in a permanent ban.
</p> </p>
<p> <p>
CoC Working Group members and forum moderators are held to a higher standard than other community members. Moderators are held to a higher standard than other community members.
If a working group member or moderator creates an inappropriate situation, they If a moderator creates an inappropriate situation, they should expect less
should expect less leeway than others, and should expect to be removed from leeway than others, and should expect to be removed from their position if they
their position if they cannot adhere to the CoC. cannot adhere to the CoC.
</p> </p>
<p> <p>
Complaints about working group member or moderator actions must be handled Complaints about moderator actions must be handled using the reporting process
using the reporting process below. below.
</p> </p>
<h2 id="reporting">Reporting issues</h2> <h2 id="reporting">Reporting issues</h2>
@@ -182,6 +185,8 @@ satisfaction of all parties. They are:
<ul> <ul>
<li>Aditya Mukerjee &lt;dev@chimeracoder.net&gt; <li>Aditya Mukerjee &lt;dev@chimeracoder.net&gt;
<li>Andrew Gerrand &lt;adg@golang.org&gt; <li>Andrew Gerrand &lt;adg@golang.org&gt;
<li>Dave Cheney &lt;dave@cheney.net&gt;
<li>Jason Buberel &lt;jbuberel@google.com&gt;
<li>Peggy Li &lt;peggyli.224@gmail.com&gt; <li>Peggy Li &lt;peggyli.224@gmail.com&gt;
<li>Sarah Adams &lt;sadams.codes@gmail.com&gt; <li>Sarah Adams &lt;sadams.codes@gmail.com&gt;
<li>Steve Francia &lt;steve.francia@gmail.com&gt; <li>Steve Francia &lt;steve.francia@gmail.com&gt;
@@ -196,10 +201,13 @@ particular individual or group.
</p> </p>
<ul> <ul>
<li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a>. <li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a> or
<a href="https://golang.org/s/conduct-report">submit an anonymous report</a>.
<ul> <ul>
<li>Your message will reach the Working Group. <li>Your message will reach the Working Group.
<li>Reports are confidential within the Working Group. <li>Reports are confidential within the Working Group.
<li>Should you choose to remain anonymous then the Working Group cannot
notify you of the outcome of your report.
<li>You may contact a member of the group directly if you do not feel <li>You may contact a member of the group directly if you do not feel
comfortable contacting the group as a whole. That member will then raise comfortable contacting the group as a whole. That member will then raise
the issue with the Working Group as a whole, preserving the privacy of the the issue with the Working Group as a whole, preserving the privacy of the
@@ -221,8 +229,11 @@ particular individual or group.
<li>The Working Group will reach a decision as to how to act. These may include: <li>The Working Group will reach a decision as to how to act. These may include:
<ul> <ul>
<li>Nothing. <li>Nothing.
<li>Passing the report along to the offender. <li>A request for a private or public apology.
<li>A recommendation of action to the relevant forum moderators. <li>A private or public warning.
<li>An imposed vacation (for instance, asking someone to abstain for a week
from a mailing list or IRC).
<li>A permanent or temporary ban from some or all Go spaces.
</ul> </ul>
<li>The Working Group will reach out to the original reporter to let them know <li>The Working Group will reach out to the original reporter to let them know
the decision. the decision.
@@ -235,6 +246,7 @@ particular individual or group.
conflicts in the most harmonious way possible.</b> conflicts in the most harmonious way possible.</b>
We hope that in most cases issues may be resolved through polite discussion and We hope that in most cases issues may be resolved through polite discussion and
mutual agreement. mutual agreement.
Bannings and other forceful measures are to be employed only as a last resort.
</p> </p>
<p> <p>

View File

@@ -34,7 +34,6 @@ We encourage all Go users to subscribe to
<p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p> <p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p>
<ul> <ul>
<li><a href="/doc/go1.8">Go 1.8</a> <small>(February 2017)</small></li>
<li><a href="/doc/go1.7">Go 1.7</a> <small>(August 2016)</small></li> <li><a href="/doc/go1.7">Go 1.7</a> <small>(August 2016)</small></li>
<li><a href="/doc/go1.6">Go 1.6</a> <small>(February 2016)</small></li> <li><a href="/doc/go1.6">Go 1.6</a> <small>(February 2016)</small></li>
<li><a href="/doc/go1.5">Go 1.5</a> <small>(August 2015)</small></li> <li><a href="/doc/go1.5">Go 1.5</a> <small>(August 2015)</small></li>

View File

@@ -1,12 +1,14 @@
<!--{ <!--{
"Title": "Contribution Guide" "Title": "Contribution Guidelines"
}--> }-->
<h2 id="Introduction">Introduction</h2>
<p> <p>
The Go project welcomes all contributors. The process of contributing This document explains how to contribute changes to the Go project.
to the Go project may be different than many projects you are used to. It assumes you have followed the
This document is intended as a guide to help you through the contribution <a href="/doc/install/source">installation instructions</a> and
process. This guide assumes you have a basic understanding of Git and Go. have <a href="code.html">written and tested your code</a>.
</p> </p>
<p> <p>
@@ -18,73 +20,103 @@ see <a href="gccgo_contribute.html">Contributing to gccgo</a>.)
Sensitive security-related issues should be reported to <a href="mailto:security@golang.org">security@golang.org</a>. Sensitive security-related issues should be reported to <a href="mailto:security@golang.org">security@golang.org</a>.
</p> </p>
<h1 id="contributor">Becoming a contributor</h1> <h2 id="Design">Discuss your design</h2>
<p> <p>
Before you can contribute to the Go project you need to setup a few prerequisites. The project welcomes submissions but please let everyone know what
The Go project uses <a href="https://www.gerritcodereview.com/">Gerrit</a>, an open you're working on if you want to change or add to the Go repositories.
source online tool, to perform all code reviews.
Gerrit uses your email address as a unique identifier.
The Go project contributing flow is currently configured to work only with Google Accounts.
You must go through the following process <em>prior to contributing</em>.
You only need to do this once per Google Account.
</p> </p>
<h2 id="go-contrib-init">Automatically set up &amp; diagnose your development environment</h3>
<p> <p>
The <code>go-contrib-init</code> tool configures and debugs your Go Before undertaking to write something new for the Go project,
development environment, automatically performing many of the steps please <a href="https://golang.org/issue/new">file an issue</a>
on this page, or telling you what you need to do next. If you wish (or claim an <a href="https://golang.org/issues">existing issue</a>).
to use it, run: Significant changes must go through the
<a href="https://golang.org/s/proposal-process">change proposal process</a>
before they can be accepted.
</p>
<p>
This process gives everyone a chance to validate the design,
helps prevent duplication of effort,
and ensures that the idea fits inside the goals for the language and tools.
It also checks that the design is sound before code is written;
the code review tool is not the place for high-level discussions.
</p>
<p>
When planning work, please note that the Go project follows a
<a href="https://golang.org/wiki/Go-Release-Cycle">six-month
development cycle</a>. The latter half of each cycle is a three-month
feature freeze during which only bug fixes and doc updates are accepted.
New work cannot be submitted during a feature freeze.
</p>
<h2 id="Testing">Testing redux</h2>
<p>
You've <a href="code.html">written and tested your code</a>, but
before sending code out for review, run all the tests for the whole
tree to make sure the changes don't break other packages or programs:
</p> </p>
<pre> <pre>
$ go get -u golang.org/x/tools/cmd/go-contrib-init $ cd go/src
$ cd /code/to/edit $ ./all.bash
$ go-contrib-init
</pre> </pre>
<p> <p>
The tool will either set things up, tell you that everything is (To build under Windows use <code>all.bat</code>.)
configured, or tell you what steps you need to do manually.
</p>
<h2 id="auth">Configure Git to use Gerrit</h2>
<p>
You'll need a web browser and a command line terminal.
You should already have Git installed.
</p> </p>
<p> <p>
Gerrit uses Google Accounts for authentication. After running for a while, the command should print
If you don't have a Google Account, you can create an account which "<code>ALL</code> <code>TESTS</code> <code>PASSED</code>".
</p>
<h2 id="Code_review">Code review</h2>
<p>
Changes to Go must be reviewed before they are accepted,
no matter who makes the change.
A custom git command called <code>git-codereview</code>,
discussed below, helps manage the code review process through a Google-hosted
<a href="https://go-review.googlesource.com/">instance</a> of the code review
system called <a href="https://www.gerritcodereview.com/">Gerrit</a>.
</p>
<h3 id="auth">Set up authentication for code review</h3>
<p>
Gerrit uses Google Accounts for authentication. If you don't have
a Google Account, you can create an account which
<a href="https://www.google.com/accounts/NewAccount">includes <a href="https://www.google.com/accounts/NewAccount">includes
a new Gmail email account</a> or create an account associated a new Gmail email account</a> or create an account associated
<a href="https://accounts.google.com/SignUpWithoutGmail">with your existing <a href="https://accounts.google.com/SignUpWithoutGmail">with your existing
email address</a>. email address</a>.
</p> </p>
<h3>Step 1: Sign in to googlesource and generate a password</h3> <p>
The email address associated with the Google Account you use will be recorded in
the <a href="https://go.googlesource.com/go/+log/">change log</a>
and in the <a href="/CONTRIBUTORS">contributors file</a>.
</p>
<p> <p>
Visit <a href="https://go.googlesource.com">go.googlesource.com</a> To set up your account in Gerrit, visit
<a href="https://go.googlesource.com">go.googlesource.com</a>
and click on "Generate Password" in the page's top right menu bar. and click on "Generate Password" in the page's top right menu bar.
</p>
<p>
You will be redirected to accounts.google.com to sign in. You will be redirected to accounts.google.com to sign in.
</p> </p>
<h3>Step 2: Run the provided script</h3>
<p> <p>
After signing in, you are taken to a page on go.googlesource.com with the title "Configure Git". Once signed in, you are returned back to go.googlesource.com to "Configure Git".
This page contains a personalized script which when run locally will configure git Follow the instructions on the page.
to have your unique authentication key. (If you are on a Windows computer, you should instead follow the instructions
This key is paired with one generated server side similar to how ssh keys work. in the yellow box to run the command.)
</p>
<p>
Copy and run this script locally in your command line terminal.
(On a Windows computer using cmd you should instead follow the instructions
in the yellow box to run the command. If you are using git-bash use the same
script as *nix.)
</p> </p>
<p> <p>
@@ -92,25 +124,23 @@ Your secret authentication token is now in a <code>.gitcookie</code> file
and Git is configured to use this file. and Git is configured to use this file.
</p> </p>
<h3 id="gerrit">Step 3: Register with Gerrit</h3> <h3 id="gerrit">Register with Gerrit</h3>
<p> <p>
Now that you have your authentication token, you need to register your Now that you have your authentication token,
account with Gerrit. you need to register your account with Gerrit.
To do this, visit <a href="https://go-review.googlesource.com/login/"> To do this, visit
go-review.googlesource.com/login/</a>. <a href="https://go-review.googlesource.com/login/">
Sign in using the same Google Account you used above. go-review.googlesource.com/login/</a>. You will immediately be redirected
to Google Accounts. Sign in using the same Google Account you used above.
That is all that is required.
</p> </p>
<h2 id="cla">Contributor License Agreement</h2> <h3 id="cla">Contributor License Agreement</h3>
<h3 id="which_cla">Which CLA</h3>
<p>
Before sending your first change to the Go project
you must have completed one of the following two CLAs.
Which CLA you should sign depends on who owns the copyright to your work.
</p>
<p>Gerrit serves as the gatekeeper and uses your e-mail address as the key.
To send your first change to the Go project from a given address,
you must have completed one of the contributor license agreements:
<ul> <ul>
<li> <li>
If you are the copyright holder, you will need to agree to the If you are the copyright holder, you will need to agree to the
@@ -121,49 +151,37 @@ contributor license agreement</a>, which can be completed online.
If your organization is the copyright holder, the organization If your organization is the copyright holder, the organization
will need to agree to the will need to agree to the
<a href="https://developers.google.com/open-source/cla/corporate">corporate <a href="https://developers.google.com/open-source/cla/corporate">corporate
contributor license agreement</a>.<br> contributor license agreement</a>.
(If the copyright holder for your code has already completed the
agreement in connection with another Google open source project,
it does not need to be completed again.)
</li> </li>
</ul> </ul>
<p> <p>
<i>If the copyright holder for your contribution has already completed the You can use the links above to create and sign the contributor license agreement
agreement in connection with another Google open source project, or you can show your current agreements and create new ones through the Gerrit
it does not need to be completed again.</i> interface. <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
</p> click your name in the upper-right, choose "Settings", then select "Agreements"
from the topics on the left. If you do not have a signed agreement listed here,
<h3 id="signing_cla">Completing the CLA</h3> you can create one by clicking "New Contributor Agreement" and following the steps.
<p>
You can see your currently signed agreements and sign new ones through the Gerrit
interface.
To do this, <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
then visit the <a href="https://go-review.googlesource.com/settings/agreements">Agreements</a>
page.
If you do not have a signed agreement listed there, you can create one
by clicking "New Contributor Agreement" and following the steps.
</p> </p>
<p> <p>
If the copyright holder for the code you are submitting changes &mdash; for example, This rigmarole only needs to be done for your first submission for each email address.
if you start contributing code on behalf of a new company &mdash; please send email
to golang-dev and let us know, so that we can make sure an appropriate agreement is
completed and update the <code>AUTHORS</code> file.
</p> </p>
<span id="Code_review"></span>
<h1 id="prepare_dev_env">Preparing a Development Environment for Contributing</h1>
<h2 id="git-codereview">Setting up Git for submission to Gerrit</h2>
<p> <p>
Changes to Go must be reviewed before they are accepted, no matter who makes the change. If the copyright holder for the code you are submitting changes—for example,
A custom git command called <code>git-codereview</code>, discussed below, if you start contributing code on behalf of a new company—please send email
helps manage the code review process through a Google-hosted to let us know, so that we can make sure an appropriate agreement is completed
<a href="https://go-review.googlesource.com/">instance</a> Gerrit. and update the <code>AUTHORS</code> file.
</p> </p>
<h3 id="git-codereview_install">Install the git-codereview command</h3> <h3 id="git-codereview">Install the git-codereview command</h3>
<p> <p>
Install the <code>git-codereview</code> command by running, Now install the <code>git-codereview</code> command by running,
</p> </p>
<pre> <pre>
@@ -183,29 +201,19 @@ $ git codereview help
prints help text, not an error. prints help text, not an error.
</p> </p>
<p>
On Windows, when using git-bash you must make sure that
<code>git-codereview.exe</code> is in your git exec-path.
Run <code>git --exec-path</code> to discover the right location then create a
symbolic link or simply copy the executible from $GOPATH/bin to this directory.
</p>
<p> <p>
<b>Note to Git aficionados:</b> <b>Note to Git aficionados:</b>
The <code>git-codereview</code> command is not required to The <code>git-codereview</code> command is not required to
upload and manage Gerrit code reviews. upload and manage Gerrit code reviews. For those who prefer plain Git, the text
For those who prefer plain Git, the text below gives the Git equivalent of below gives the Git equivalent of each git-codereview command.
each git-codereview command.
</p> </p>
<p> <p>If you do use plain
If you do use plain Git, note that you still need the commit hooks that the Git, note that you still need the commit hooks that the git-codereview command
git-codereview command configures; those hooks add a Gerrit configures; those hooks add a Gerrit <code>Change-Id</code> line to the commit
<code>Change-Id</code> line to the commit message and check that all Go source message and check that all Go source files have been formatted with gofmt. Even
files have been formatted with gofmt. if you intend to use plain Git for daily work, install the hooks in a new Git
Even if you intend to use plain Git for checkout by running <code>git-codereview</code> <code>hooks</code>.
daily work, install the hooks in a new Git checkout by running
<code>git-codereview</code> <code>hooks</code>.
</p> </p>
<p> <p>
@@ -256,8 +264,7 @@ To install them, copy this text into your Git configuration file
sync = codereview sync sync = codereview sync
</pre> </pre>
<span id="help"></span> <h3 id="help">Understanding the git-codereview command</h3>
<h3 id="understanding_git-codereview">Understanding the git-codereview command</h3>
<p>After installing the <code>git-codereview</code> command, you can run</p> <p>After installing the <code>git-codereview</code> command, you can run</p>
@@ -270,70 +277,11 @@ to learn more about its commands.
You can also read the <a href="https://godoc.org/golang.org/x/review/git-codereview">command documentation</a>. You can also read the <a href="https://godoc.org/golang.org/x/review/git-codereview">command documentation</a>.
</p> </p>
<h3 id="master">Switch to the master branch</h3>
<h1 id="making_a_contribution">Making a Contribution</h1>
<h2 id="Design">Discuss your design</h2>
<p>
The project welcomes submissions but please let everyone know what
you're working on if you want to change or add to the Go repositories.
</p>
<p>
Before undertaking to write something new for the Go project,
please <a href="https://golang.org/issue/new">file an issue</a>
(or claim an <a href="https://golang.org/issues">existing issue</a>).
Significant changes must go through the
<a href="https://golang.org/s/proposal-process">change proposal process</a>
before they can be accepted.
</p>
<p>
This process gives everyone a chance to validate the design,
helps prevent duplication of effort,
and ensures that the idea fits inside the goals for the language and tools.
It also checks that the design is sound before code is written;
the code review tool is not the place for high-level discussions.
</p>
<p>
When planning work, please note that the Go project follows a <a
href="https://golang.org/wiki/Go-Release-Cycle">six-month development cycle</a>.
The latter half of each cycle is a three-month feature freeze during
which only bug fixes and doc updates are accepted. New contributions can be
sent during a feature freeze but will not be accepted until the freeze thaws.
</p>
<h2 id="making_a_change">Making a change</h2>
<h3 id="checkout_go">Getting Go Source</h3>
<p>
First you need to have a local copy of the source checked out from the correct
repository.
As Go builds Go you will also likely need to have a working version
of Go installed (some documentation changes may not need this).
This should be a recent version of Go and can be obtained via any package or
binary distribution or you can build it from source.
</p>
<p>
You should checkout the Go source repo anywhere you want as long as it's
outside of your $GOPATH.
Go to a directory where you want the source to appear and run the following
command in a terminal.
</p>
<pre>
$ git clone https://go.googlesource.com/go
$ cd go
</pre>
<h3 id="master">Contributing to the main Go tree</h3>
<p> <p>
Most Go installations use a release branch, but new changes should Most Go installations use a release branch, but new changes should
only be made based on the master branch. <br> only be made based on the master branch.
(They may be applied later to a release branch as part of the release process, (They may be applied later to a release branch as part of the release process,
but most contributors won't do this themselves.) but most contributors won't do this themselves.)
Before making a change, make sure you start on the master branch: Before making a change, make sure you start on the master branch:
@@ -349,61 +297,10 @@ $ git sync
<code>git</code> <code>pull</code> <code>-r</code>.) <code>git</code> <code>pull</code> <code>-r</code>.)
</p> </p>
<h3 id="subrepos">Contributing to subrepositories (golang.org/x/...)</h3> <h3 id="change">Make a change</h3>
<p>
If you are contributing a change to a subrepository, obtain the
Go package using <code>go get</code>. For example, to contribute
to <code>golang.org/x/oauth2</code>, check out the code by running:
</p>
<pre>
$ go get -d golang.org/x/oauth2/...
</pre>
<p>
Then, change your directory to the package's source directory
(<code>$GOPATH/src/golang.org/x/oauth2</code>).
</p>
<h3 id="change">Make your changes</h3>
<p>
The entire checked-out tree is editable.
Make your changes as you see fit ensuring that you create appropriate
tests along with your changes. Test your changes as you go.
</p>
<h3 id="copyright">Copyright</h3>
<p>
Files in the Go repository don't list author names, both to avoid clutter
and to avoid having to keep the lists up to date.
Instead, your name will appear in the
<a href="https://golang.org/change">change log</a> and in the <a
href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file and perhaps the <a
href="/AUTHORS"><code>AUTHORS</code></a> file.
These files are automatically generated from the commit logs perodically.
The <a href="/AUTHORS"><code>AUTHORS</code></a> file defines who &ldquo;The Go
Authors&rdquo;&mdash;the copyright holders&mdash;are.
</p>
<p>New files that you contribute should use the standard copyright header:</p>
<pre>
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
</pre>
<p>
Files in the repository are copyright the year they are added.
Do not update the copyright year on files that you change.
</p>
<h3 id="commit_changes">Commit your changes</h3>
<p> <p>
The entire checked-out tree is writable.
Once you have edited files, you must tell Git that they have been modified. Once you have edited files, you must tell Git that they have been modified.
You must also tell Git about any files that are added, removed, or renamed files. You must also tell Git about any files that are added, removed, or renamed files.
These operations are done with the usual Git commands, These operations are done with the usual Git commands,
@@ -414,20 +311,16 @@ and
</p> </p>
<p> <p>
Once you have the changes queued up, you will want to commit them. If you wish to checkpoint your work, or are ready to send the code out for review, run</p>
In the Go contribution workflow this is done with a <code>git</code>
<code>change</code> command, which creates a local branch and commits the changes
directly to that local branch.
</p>
<pre> <pre>
$ git change <i>&lt;branch&gt;</i> $ git change <i>&lt;branch&gt;</i>
</pre> </pre>
<p> <p>
from any directory in your Go repository to commit the changes so far.
The name <i>&lt;branch&gt;</i> is an arbitrary one you choose to identify the The name <i>&lt;branch&gt;</i> is an arbitrary one you choose to identify the
local branch containing your changes and will not be used elsewhere. local branch containing your changes.
This is an offline operation and nothing will be sent to the server yet.
</p> </p>
<p> <p>
@@ -438,11 +331,9 @@ then <code>git</code> <code>commit</code>.)
</p> </p>
<p> <p>
As the <code>git</code> <code>commit</code> is the final step, Git will open an Git will open a change description file in your editor.
editor to ask for a commit message. (It uses the editor named by (It uses the editor named by the <code>$EDITOR</code> environment variable,
the <code>$EDITOR</code> environment variable,
<code>vi</code> by default.) <code>vi</code> by default.)
The file will look like: The file will look like:
</p> </p>
@@ -461,7 +352,7 @@ At the beginning of this file is a blank line; replace it
with a thorough description of your change. with a thorough description of your change.
The first line of the change description is conventionally a one-line The first line of the change description is conventionally a one-line
summary of the change, prefixed by the primary affected package, summary of the change, prefixed by the primary affected package,
and is used as the subject for code review email. and is used as the subject for code review mail.
It should complete the sentence "This change modifies Go to _____." It should complete the sentence "This change modifies Go to _____."
The rest of the description elaborates and should provide context for the The rest of the description elaborates and should provide context for the
change and explain what it does. change and explain what it does.
@@ -496,7 +387,7 @@ Fixes #159
<p> <p>
The commented section of the file lists all the modified files in your client. The commented section of the file lists all the modified files in your client.
It is best to keep unrelated changes in different commits, It is best to keep unrelated changes in different change lists,
so if you see a file listed that should not be included, abort so if you see a file listed that should not be included, abort
the command and move that file to a different branch. the command and move that file to a different branch.
</p> </p>
@@ -504,7 +395,7 @@ the command and move that file to a different branch.
<p> <p>
The special notation "Fixes #159" associates the change with issue 159 in the The special notation "Fixes #159" associates the change with issue 159 in the
<a href="https://golang.org/issue/159">Go issue tracker</a>. <a href="https://golang.org/issue/159">Go issue tracker</a>.
When this change is eventually applied, the issue When this change is eventually submitted, the issue
tracker will automatically mark the issue as fixed. tracker will automatically mark the issue as fixed.
(There are several such conventions, described in detail in the (There are several such conventions, described in detail in the
<a href="https://help.github.com/articles/closing-issues-via-commit-messages/">GitHub Issue Tracker documentation</a>.) <a href="https://help.github.com/articles/closing-issues-via-commit-messages/">GitHub Issue Tracker documentation</a>.)
@@ -515,13 +406,6 @@ Once you have finished writing the commit message,
save the file and exit the editor. save the file and exit the editor.
</p> </p>
<p>
You must have the $EDITOR environment variable set properly and working properly (exiting cleanly)
for this operation to succeed.
If you run into any issues at this step, it's likely your editor isn't exiting cleanly.
Try setting a different editor in your $EDITOR environment variable.
</p>
<p> <p>
If you wish to do more editing, re-stage your changes using If you wish to do more editing, re-stage your changes using
<code>git</code> <code>add</code>, and then run <code>git</code> <code>add</code>, and then run
@@ -532,8 +416,8 @@ $ git change
</pre> </pre>
<p> <p>
to update the change description and incorporate the staged changes. to update the change description and incorporate the staged changes. The
The change description contains a <code>Change-Id</code> line near the bottom, change description contains a <code>Change-Id</code> line near the bottom,
added by a Git commit hook during the initial added by a Git commit hook during the initial
<code>git</code> <code>change</code>. <code>git</code> <code>change</code>.
That line is used by Gerrit to match successive uploads of the same change. That line is used by Gerrit to match successive uploads of the same change.
@@ -545,44 +429,35 @@ Do not edit or delete it.
runs <code>git</code> <code>commit</code> <code>--amend</code>.) runs <code>git</code> <code>commit</code> <code>--amend</code>.)
</p> </p>
<h3 id="Testing">Testing</h3> <h3 id="mail">Mail the change for review</h3>
<p> <p>
You've <a href="code.html">written and tested your code</a>, but Once the change is ready, mail it out for review:
before sending code out for review, run all the tests for the whole
tree to make sure the changes don't break other packages or programs:
</p>
<pre>
$ cd go/src
$ ./all.bash
</pre>
<p>
(To build under Windows use <code>all.bat</code>.)
</p>
<p>
After running for a while, the command should print
</p>
<pre>
"ALL TESTS PASSED".
</pre>
<h3 id="mail">Send the change for review</h3>
<p>
Once the change is ready, send it for review.
This is similar to a <code>git push</code> in a GitHub style workflow.
This is done via the mail alias setup earlier which despite its name, doesn't
directly mail anything, it simply sends the change to Gerrit via git push.
</p> </p>
<pre> <pre>
$ git mail $ git mail
</pre> </pre>
<p>
You can specify a reviewer or CC interested parties
using the <code>-r</code> or <code>-cc</code> options.
Both accept a comma-separated list of email addresses:
</p>
<pre>
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
</pre>
<p>
Unless explicitly told otherwise, such as in the discussion leading
up to sending in the change list, it's better not to specify a reviewer.
All changes are automatically CC'ed to the
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
mailing list. If this is your first ever change, there may be a moderation
delay before it appears on the mailing list, to prevent spam.
</p>
<p> <p>
(In Git terms, <code>git</code> <code>mail</code> pushes the local committed (In Git terms, <code>git</code> <code>mail</code> pushes the local committed
changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code> changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
@@ -591,7 +466,7 @@ changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
<p> <p>
If your change relates to an open issue, please add a comment to the issue If your change relates to an open issue, please add a comment to the issue
announcing your proposed fix, including a link to your change. announcing your proposed fix, including a link to your CL.
</p> </p>
<p> <p>
@@ -604,76 +479,7 @@ remote: New Changes:
remote: https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments remote: https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
</pre> </pre>
<h3>Troubleshooting</h3> <h3 id="review">Reviewing code</h3>
<p>
The most common way that the <code>git mail</code> command fails is because the
email address used has not gone through the setup above.
<br>
If you see something like...
</p>
<pre>
remote: Processing changes: refs: 1, done
remote:
remote: ERROR: In commit ab13517fa29487dcf8b0d48916c51639426c5ee9
remote: ERROR: author email address XXXXXXXXXXXXXXXXXXX
remote: ERROR: does not match your user account.
</pre>
<p>
You need to either add the email address listed to the CLA or set this repo to use
another email address already approved.
</p>
<p>
First let's change the email address for this repo so this doesn't happen again.
You can change your email address for this repo with the following command:
</p>
<pre>
$ git config user.email email@address.com
</pre>
<p>
Then change the previous commit to use this alternative email address.
You can do that with:
</p>
<pre>
$ git commit --amend --author="Author Name &lt;email@address.com&gt;"
</pre>
<p>
Finally try to resend with:
</p>
<pre>
$ git mail
</pre>
<h3 id="cc">Specifying a reviewer / CCing others</h3>
<p>
Unless explicitly told otherwise, such as in the discussion leading
up to sending in the change, it's better not to specify a reviewer.
All changes are automatically CC'ed to the
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
mailing list. If this is your first ever change, there may be a moderation
delay before it appears on the mailing list, to prevent spam.
</p>
<p>
You can specify a reviewer or CC interested parties
using the <code>-r</code> or <code>-cc</code> options.
Both accept a comma-separated list of email addresses:
</p>
<pre>
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
</pre>
<h2 id="review">Going through the review process</h2>
<p> <p>
Running <code>git</code> <code>mail</code> will send an email to you and the Running <code>git</code> <code>mail</code> will send an email to you and the
@@ -685,15 +491,7 @@ You must reply through the web interface.
(Unlike with the old Rietveld review system, replying by mail has no effect.) (Unlike with the old Rietveld review system, replying by mail has no effect.)
</p> </p>
<h3 id="revise">Revise and resend</h3> <h3 id="revise">Revise and upload</h3>
<p>
The Go contribution workflow is optimized for iterative revisions based on
feedback.
It is rare that an initial contribution will be ready to be applied as is.
As you revise your contribution and resend Gerrit will retain a history of
all the changes and comments made in the single URL.
</p>
<p> <p>
You must respond to review comments through the web interface. You must respond to review comments through the web interface.
@@ -704,7 +502,7 @@ You must respond to review comments through the web interface.
When you have revised the code and are ready for another round of review, When you have revised the code and are ready for another round of review,
stage those changes and use <code>git</code> <code>change</code> to update the stage those changes and use <code>git</code> <code>change</code> to update the
commit. commit.
To send the updated change for another round of review, To send the update change list for another round of review,
run <code>git</code> <code>mail</code> again. run <code>git</code> <code>mail</code> again.
</p> </p>
@@ -736,8 +534,6 @@ $ git sync
<code>git</code> <code>pull</code> <code>-r</code>.) <code>git</code> <code>pull</code> <code>-r</code>.)
</p> </p>
<h3 id="resolving_conflicts">Resolving Conflicts</h3>
<p> <p>
If files you were editing have changed, Git does its best to merge the If files you were editing have changed, Git does its best to merge the
remote changes into your local changes. remote changes into your local changes.
@@ -813,8 +609,8 @@ might turn up:
<p> <p>
Git doesn't show it, but suppose the original text that both edits Git doesn't show it, but suppose the original text that both edits
started with was 1e8; you changed it to 1e10 and the other change to 1e9, started with was 1e8; you changed it to 1e10 and the other change to 1e9,
so the correct answer might now be 1e10. so the correct answer might now be 1e10. First, edit the section
First, edit the section to remove the markers and leave the correct code: to remove the markers and leave the correct code:
</p> </p>
<pre> <pre>
@@ -843,13 +639,10 @@ restore the change commit.
<h3 id="download">Reviewing code by others</h3> <h3 id="download">Reviewing code by others</h3>
<p> <p>
As part of the review process reviewers can propose changes directly (in the You can import a change proposed by someone else into your local Git repository.
GitHub workflow this would be someone else attaching commits to a pull request).
You can import these changes proposed by someone else into your local Git repository.
On the Gerrit review page, click the "Download ▼" link in the upper right On the Gerrit review page, click the "Download ▼" link in the upper right
corner, copy the "Checkout" command and run it from your local Git repo. It corner, copy the "Checkout" command and run it from your local Git repo.
should look something like this: It should look something like this:
</p> </p>
<pre> <pre>
@@ -860,11 +653,11 @@ $ git fetch https://go.googlesource.com/review refs/changes/21/1221/1 &amp;&amp;
To revert, change back to the branch you were working in. To revert, change back to the branch you were working in.
</p> </p>
<h2 id="submit">Apply the change to the master branch</h2> <h3 id="submit">Submit the change after the review</h3>
<p> <p>
After the code has been <code>LGTM</code>'ed, an approver may After the code has been <code>LGTM</code>'ed, an approver may
apply it to the master branch using the Gerrit UI. submit it to the master branch using the Gerrit UI.
There is a "Submit" button on the web page for the change There is a "Submit" button on the web page for the change
that appears once the change is approved (marked +2). that appears once the change is approved (marked +2).
</p> </p>
@@ -876,13 +669,41 @@ and the code review will be updated with a link to the change
in the repository. in the repository.
Since the method used to integrate the changes is "Cherry Pick", Since the method used to integrate the changes is "Cherry Pick",
the commit hashes in the repository will be changed by the commit hashes in the repository will be changed by
the "Submit" operation. the submit operation.
</p> </p>
<h2 id="more">More information</h2> <h3 id="more">More information</h3>
<p> <p>
In addition to the information here, the Go community maintains a <a In addition to the information here, the Go community maintains a <a href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
Feel free to contribute to this page as you learn the review process. Feel free to contribute to this page as you learn the review process.
</p> </p>
<h2 id="copyright">Copyright</h2>
<p>Files in the Go repository don't list author names,
both to avoid clutter and to avoid having to keep the lists up to date.
Instead, your name will appear in the
<a href="https://golang.org/change">change log</a>
and in the <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
and perhaps the <a href="/AUTHORS"><code>AUTHORS</code></a> file.
</p>
<p>The <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
defines who the Go contributors&mdash;the people&mdash;are;
the <a href="/AUTHORS"><code>AUTHORS</code></a> file defines
who &ldquo;The Go Authors&rdquo;&mdash;the copyright holders&mdash;are.
These files will be periodically updated based on the commit logs.
<p>Code that you contribute should use the standard copyright header:</p>
<pre>
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
</pre>
<p>
Files in the repository are copyright the year they are added. It is not
necessary to update the copyright year on files that you change.
</p>

View File

@@ -4,8 +4,7 @@
}--> }-->
<p><i> <p><i>
This applies to the standard toolchain (the <code>gc</code> Go This applies to the <code>gc</code> toolchain. Gccgo has native gdb support.
compiler and tools). Gccgo has native gdb support.
Besides this overview you might want to consult the Besides this overview you might want to consult the
<a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>. <a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>.
</i></p> </i></p>
@@ -50,14 +49,6 @@ when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
debugged. debugged.
</p> </p>
<p>
If you want to use gdb to inspect a core dump, you can trigger a dump
on a program crash, on systems that permit it, by setting
<code>GOTRACEBACK=crash</code> in the environment (see the
<a href="/pkg/runtime/#hdr-Environment_Variables"> runtime package
documentation</a> for more info).
</p>
<h3 id="Common_Operations">Common Operations</h3> <h3 id="Common_Operations">Common Operations</h3>
<ul> <ul>
@@ -139,7 +130,7 @@ the DWARF code.
<p> <p>
If you're interested in what the debugging information looks like, run If you're interested in what the debugging information looks like, run
'<code>objdump -W a.out</code>' and browse through the <code>.debug_*</code> '<code>objdump -W 6.out</code>' and browse through the <code>.debug_*</code>
sections. sections.
</p> </p>
@@ -386,9 +377,7 @@ $3 = struct hchan&lt;*testing.T&gt;
</pre> </pre>
<p> <p>
That <code>struct hchan&lt;*testing.T&gt;</code> is the That <code>struct hchan&lt;*testing.T&gt;</code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
runtime-internal representation of a channel. It is currently empty,
or gdb would have pretty-printed its contents.
</p> </p>
<p> <p>

View File

@@ -15,45 +15,19 @@ git checkout <i>release-branch</i>
<h2 id="policy">Release Policy</h2> <h2 id="policy">Release Policy</h2>
<p> <p>
Each major Go release is supported until there are two newer major releases. Each major Go release obsoletes and ends support for the previous one.
For example, Go 1.8 is supported until Go 1.10 is released, For example, if Go 1.5 has been released, then it is the current release
and Go 1.9 is supported until Go 1.11 is released. and Go 1.4 and earlier are no longer supported.
We fix critical problems, including <a href="/security">critical security problems</a>, We fix critical problems in the current release as needed by issuing minor revisions
in supported releases as needed by issuing minor revisions (for example, Go 1.5.1, Go 1.5.2, and so on).
(for example, Go 1.8.1, Go 1.8.2, and so on).
</p>
<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
<p>
Go 1.8 is a major release of Go.
Read the <a href="/doc/go1.8">Go 1.8 Release Notes</a> for more information.
</p>
<h3 id="go1.8.minor">Minor revisions</h3>
<p>
go1.8.1 (released 2017/04/07) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command and the <code>crypto/tls</code>,
<code>encoding/xml</code>, <code>image/png</code>, <code>net</code>,
<code>net/http</code>, <code>reflect</code>, <code>text/template</code>,
and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.1">Go
1.8.1 milestone</a> on our issue tracker for details.
</p> </p>
<p> <p>
go1.8.2 (released 2017/05/23) includes a security fix to the As a special case, we issue minor revisions for critical security problems
<code>crypto/elliptic</code> package. in both the current release and the previous release.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go For example, if Go 1.5 is the current release then we will issue minor revisions
1.8.2 milestone</a> on our issue tracker for details. to fix critical security problems in both Go 1.4 and Go 1.5 as they arise.
</p> See the <a href="/security">security policy</a> for more details.
<p>
go1.8.3 (released 2017/05/24) includes fixes to the compiler, runtime,
documentation, and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.3">Go
1.8.3 milestone</a> on our issue tracker for details.
</p> </p>
<h2 id="go1.7">go1.7 (released 2016/08/15)</h2> <h2 id="go1.7">go1.7 (released 2016/08/15)</h2>
@@ -95,20 +69,6 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
1.7.4 milestone</a> on our issue tracker for details. 1.7.4 milestone</a> on our issue tracker for details.
</p> </p>
<p>
go1.7.5 (released 2017/01/26) includes fixes to the compiler, runtime,
and the <code>crypto/x509</code> and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.5">Go
1.7.5 milestone</a> on our issue tracker for details.
</p>
<p>
go1.7.6 (released 2017/05/23) includes the same security fix as Go 1.8.2 and
was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.6">go1.6 (released 2016/02/17)</h2> <h2 id="go1.6">go1.6 (released 2016/02/17)</h2>
<p> <p>

View File

@@ -57,12 +57,6 @@ explains how to use the <a href="/cmd/go/">go command</a> to fetch, build, and
install packages, commands, and run tests. install packages, commands, and run tests.
</p> </p>
<h3 id="editors"><a href="editors.html">Editor plugins and IDEs</a></h3>
<p>
A document that summarizes commonly used editor plugins and IDEs with
Go support.
</p>
<h3 id="effective_go"><a href="effective_go.html">Effective Go</a></h3> <h3 id="effective_go"><a href="effective_go.html">Effective Go</a></h3>
<p> <p>
A document that gives tips for writing clear, idiomatic Go code. A document that gives tips for writing clear, idiomatic Go code.

View File

@@ -1,210 +0,0 @@
<!--{
"Title": "Editor plugins and IDEs",
"Template": true
}-->
<h2 id="introduction">Introduction</h2>
<p>
This document lists commonly used editor plugins and IDEs from the Go ecosystem
that make Go development more productive and seamless.
A comprehensive list of editor support and IDEs for Go development is available at
<a href="http://golang.org/wiki/IDEsAndTextEditorPlugins">the wiki</a>.
</p>
<h2 id="options">Options</h2>
<p>
The Go ecosystem provides a variety of editor plugins and IDEs to enhance your day-to-day
editing, navigation, testing, and debugging experience.
</p>
<ul>
<li><a href="https://github.com/fatih/vim-go">Vim Go</a>: a plugin for Vim to provide Go programming language support</li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=lukehoban.Go">Visual Studio Code Go</a>:
an extension for Visual Studio Code to provide support for the Go programming language</li>
<li><a href="https://www.jetbrains.com/go">Gogland</a>: Gogland is distributed either as a standalone IDE
or as a plugin for the IntelliJ Platform IDEs</li>
</ul>
<p>
Note that these are only a few top solutions; a more comphensive
community-maintained list of
<a href="https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins">IDEs and text editor plugins</a>
is available at the Wiki.
</p>
<p>
Each development environment integrates a number of Go-specific tools.
The following feature matrix lists and compares the most significant features.
</p>
<table class="features-matrix">
<tr>
<th></th>
<th><img title="Vim Go" src="/doc/editors/vimgo.png"><br>Vim Go</th>
<th><img title="Visual Studio Code" src="/doc/editors/vscodego.png"><br>Visual Studio Code Go</th>
<th><img title="Gogland" src="/doc/editors/gogland.png"><br>Gogland</th>
</tr>
<tr>
<td class="feature-row" colspan="4">Editing features</td>
</tr>
<tr>
<td>Build and run from the editor/IDE</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Autocompletion of identifers (variable, method, and function names)</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Autocompletion based on type</td>
<td class="no">No</td>
<td class="no">No</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Rename identifiers</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Auto format, build, vet, and lint on save</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes<sup>1</sup></td>
</tr>
<tr>
<td>Auto insert import paths and remove unused on save</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes<sup>2</sup></td>
</tr>
<tr>
<td>Auto generate JSON, XML tags for struct fields</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td class="feature-row" colspan="4">Navigation features</td>
</tr>
<tr>
<td>Display documentation inline, or open godoc in browser</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Switch between <code>*.go</code> and <code>*_test.go</code> file</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Jump to definition and referees</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Look up for interface implementations</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Search for callers and callees</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td class="feature-row" colspan="4">Testing and debugging features</td>
</tr>
<tr>
<td>Debugger support</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Run a single test case, all tests from file, or all tests from a package</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Auto generate tests for packages, files and identifiers</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td class="no">No</td>
</tr>
<tr>
<td>Debug tests</td>
<td class="no">No</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr>
<td>Display test coverage</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
<td class="yes">Yes</td>
</tr>
<tr class="download">
<td></td>
<td><a href="https://github.com/fatih/vim-go">Install<a/></td>
<td><a href="https://marketplace.visualstudio.com/items?itemName=lukehoban.Go">Install<a/></td>
<td><a href="https://www.jetbrains.com/go">Install<a/></td>
</tr>
</table>
<p>
<sup>1</sup>: Possible when enabled via Settings &gt; Go &gt; On Save, <code>go</code> <code>vet</code> and <code>golint</code> are available via plugins. Also runs tests on save if configured.
<br>
<sup>2</sup>: Additionally, user input can disambiguate when two or more options are available.
</p>
</div>
<style>
.features-matrix {
min-width: 800px;
border-collapse: collapse;
}
.features-matrix th {
width: 60px;
text-align: center;
font-size: 14px;
color: #666;
}
.features-matrix th img {
width: 48px;
}
.features-matrix .yes {
text-align: center;
}
.features-matrix .no {
text-align: center;
background-color: #ffe9e9;
}
.features-matrix .download {
font-weight: bold;
text-align: center;
}
.features-matrix td {
padding: 11px 5px 11px 5px;
border-bottom: solid 1px #ebebeb;
}
.features-matrix .feature-row {
background-color: #ebebeb;
font-weight: bold;
}
</style>
<!--TODO(jbd): Add the Atom comparison-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1580,7 +1580,7 @@ if attended[person] { // will be false if person is not in the map
<p> <p>
Sometimes you need to distinguish a missing entry from Sometimes you need to distinguish a missing entry from
a zero value. Is there an entry for <code>"UTC"</code> a zero value. Is there an entry for <code>"UTC"</code>
or is that 0 because it's not in the map at all? or is that the empty string because it's not in the map at all?
You can discriminate with a form of multiple assignment. You can discriminate with a form of multiple assignment.
</p> </p>
<pre> <pre>
@@ -1833,7 +1833,7 @@ for a min function that chooses the least of a list of integers:
</p> </p>
<pre> <pre>
func Min(a ...int) int { func Min(a ...int) int {
min := int(^uint(0) &gt;&gt; 1) // largest int min := int(^uint(0) >> 1) // largest int
for _, i := range a { for _, i := range a {
if i &lt; min { if i &lt; min {
min = i min = i

View File

@@ -52,19 +52,6 @@ user libraries. The Go 1.4 runtime is not fully merged, but that
should not be visible to Go programs. should not be visible to Go programs.
</p> </p>
<p>
The GCC 6 releases include a complete implementation of the Go 1.6.1
user libraries. The Go 1.6 runtime is not fully merged, but that
should not be visible to Go programs.
</p>
<p>
The GCC 7 releases are expected to include a complete implementation
of the Go 1.8 user libraries. As with earlier releases, the Go 1.8
runtime is not fully merged, but that should not be visible to Go
programs.
</p>
<h2 id="Source_code">Source code</h2> <h2 id="Source_code">Source code</h2>
<p> <p>
@@ -173,6 +160,23 @@ make
make install make install
</pre> </pre>
<h3 id="Ubuntu">A note on Ubuntu</h3>
<p>
Current versions of Ubuntu and versions of GCC before 4.8 disagree on
where system libraries and header files are found. This is not a
gccgo issue. When building older versions of GCC, setting these
environment variables while configuring and building gccgo may fix the
problem.
</p>
<pre>
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
</pre>
<h2 id="Using_gccgo">Using gccgo</h2> <h2 id="Using_gccgo">Using gccgo</h2>
<p> <p>
@@ -360,15 +364,12 @@ or with C++ code compiled using <code>extern "C"</code>.
<h3 id="Types">Types</h3> <h3 id="Types">Types</h3>
<p> <p>
Basic types map directly: an <code>int32</code> in Go is Basic types map directly: an <code>int</code> in Go is an <code>int</code>
an <code>int32_t</code> in C, an <code>int64</code> is in C, an <code>int32</code> is an <code>int32_t</code>,
an <code>int64_t</code>, etc. etc. Go <code>byte</code> is equivalent to C <code>unsigned
The Go type <code>int</code> is an integer that is the same size as a char</code>.
pointer, and as such corresponds to the C type <code>intptr_t</code>. Pointers in Go are pointers in C. A Go <code>struct</code> is the same as C
Go <code>byte</code> is equivalent to C <code>unsigned char</code>. <code>struct</code> with the same fields and types.
Pointers in Go are pointers in C.
A Go <code>struct</code> is the same as C <code>struct</code> with the
same fields and types.
</p> </p>
<p> <p>
@@ -379,7 +380,7 @@ structure (this is <b style="color: red;">subject to change</b>):
<pre> <pre>
struct __go_string { struct __go_string {
const unsigned char *__data; const unsigned char *__data;
intptr_t __length; int __length;
}; };
</pre> </pre>
@@ -399,8 +400,8 @@ A slice in Go is a structure. The current definition is
<pre> <pre>
struct __go_slice { struct __go_slice {
void *__values; void *__values;
intptr_t __count; int __count;
intptr_t __capacity; int __capacity;
}; };
</pre> </pre>
@@ -525,3 +526,15 @@ This procedure is full of unstated caveats and restrictions and we make no
guarantee that it will not change in the future. It is more useful as a guarantee that it will not change in the future. It is more useful as a
starting point for real Go code than as a regular procedure. starting point for real Go code than as a regular procedure.
</p> </p>
<h2 id="RTEMS_Port">RTEMS Port</h2>
<p>
The gccgo compiler has been ported to <a href="http://www.rtems.com/">
<code>RTEMS</code></a>. <code>RTEMS</code> is a real-time executive
that provides a high performance environment for embedded applications
on a range of processors and embedded hardware. The current gccgo
port is for x86. The goal is to extend the port to most of the
<a href="http://www.rtems.org/wiki/index.php/SupportedCPUs">
architectures supported by <code>RTEMS</code></a>. For more information on the port,
as well as instructions on how to install it, please see this
<a href="http://www.rtems.org/wiki/index.php/GCCGoRTEMS"><code>RTEMS</code> Wiki page</a>.

View File

@@ -15,7 +15,12 @@ Do not send CLs removing the interior tags from such phrases.
ul li { margin: 0.5em 0; } ul li { margin: 0.5em 0; }
</style> </style>
<h2 id="introduction">Introduction to Go 1.8</h2> <h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.8</h2>
<p><strong>
Go 1.8 is not yet released. These are work-in-progress
release notes. Go 1.8 is expected to be released in February 2017.
</strong></p>
<p> <p>
The latest Go release, version 1.8, arrives six months after <a href="go1.7">Go 1.7</a>. The latest Go release, version 1.8, arrives six months after <a href="go1.7">Go 1.7</a>.
@@ -88,8 +93,7 @@ On OpenBSD, Go now requires OpenBSD 5.9 or later. <!-- CL 34093 -->
<p> <p>
The Plan 9 port's networking support is now much more complete The Plan 9 port's networking support is now much more complete
and matches the behavior of Unix and Windows with respect to deadlines and matches the behavior of Unix and Windows with respect to deadlines
and cancelation. For Plan 9 kernel requirements, see the and cancelation.
<a href="https://golang.org/wiki/Plan9">Plan 9 wiki page</a>.
</p> </p>
<p> <p>
@@ -430,11 +434,11 @@ version of gccgo.
<h3 id="plugin">Plugins</h3> <h3 id="plugin">Plugins</h3>
<p> <p>
Go now provides early support for plugins with a “<code>plugin</code> Go now supports a “<code>plugin</code> build mode for generating
build mode for generating plugins written in Go, and a plugins written in Go, and a
new <a href="/pkg/plugin/"><code>plugin</code></a> package for new <a href="/pkg/plugin/"><code>plugin</code></a> package for
loading such plugins at run time. Plugin support is currently only loading such plugins at run time. Plugin support is only currently
available on Linux. Please report any issues. available on Linux.
</p> </p>
<h2 id="runtime">Runtime</h2> <h2 id="runtime">Runtime</h2>
@@ -794,9 +798,9 @@ Optimizations and minor bug fixes are not listed.
hardware support for AES-GCM is present. hardware support for AES-GCM is present.
</p> </p>
<p> <!-- CL 27315, CL 35290 --> <p> <!-- CL 27315 -->
AES-128-CBC cipher suites with SHA-256 are also AES-128-CBC cipher suites with SHA-256 are also
now supported, but disabled by default. now supported.
</p> </p>
</dd> </dd>
@@ -804,6 +808,11 @@ Optimizations and minor bug fixes are not listed.
<dl id="crypto_x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt> <dl id="crypto_x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
<dd> <dd>
<p> <!-- CL 30578 -->
<a href="/pkg/crypto/x509/#SystemCertPool"><code>SystemCertPool</code></a>
is now implemented on Windows.
</p>
<p> <!-- CL 24743 --> <p> <!-- CL 24743 -->
PSS signatures are now supported. PSS signatures are now supported.
</p> </p>
@@ -854,12 +863,11 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
<p> <p>
The <a href="/pkg/database/sql#IsolationLevel"><code>IsolationLevel</code></a> The <a href="/pkg/database/sql#IsolationLevel"><code>IsolationLevel</code></a>
can now be set when starting a transaction by setting the isolation level can now be set when starting a transaction by setting the isolation level
on <a href="/pkg/database/sql#TxOptions.Isolation"><code>TxOptions.Isolation</code></a> and passing on the <code>Context</code> then passing that <code>Context</code> to
it to <a href="/pkg/database/sql#DB.BeginTx"><code>DB.BeginTx</code></a>. <a href="/pkg/database/sql#DB.BeginContext"><code>DB.BeginContext</code></a>.
An error will be returned if an isolation level is selected that the driver An error will be returned if an isolation level is selected that the driver
does not support. A read-only attribute may also be set on the transaction does not support. A read-only attribute may also be set on the transaction
by setting <a href="/pkg/database/sql/#TxOptions.ReadOnly"><code>TxOptions.ReadOnly</code></a> with <a href="/pkg/database/sql/#ReadOnlyContext"><code>ReadOnlyContext</code></a>.
to true.
</p> </p>
<p> <p>
Queries now expose the SQL column type information for drivers that support it. Queries now expose the SQL column type information for drivers that support it.
@@ -1304,7 +1312,7 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
request must have the new request must have the new
<a href="/pkg/net/http/#Request"><code>Request.GetBody</code></a> <a href="/pkg/net/http/#Request"><code>Request.GetBody</code></a>
field defined. field defined.
<a href="/pkg/net/http/#NewRequest"><code>NewRequest</code></a> <a href="pkg/net/http/#NewRequest"><code>NewRequest</code></a>
sets <code>Request.GetBody</code> automatically for common sets <code>Request.GetBody</code> automatically for common
body types. body types.
</li> </li>
@@ -1609,9 +1617,9 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
June 31 and July 32. June 31 and July 32.
</p> </p>
<p> <!-- CL 33029 --> <!-- CL 34816 --> <p> <!-- CL 33029 -->
The <code>tzdata</code> database has been updated to version The <code>tzdata</code> database has been updated to version
2016j for systems that don't already have a local time zone 2016i for systems that don't already have a local time zone
database. database.
</p> </p>
@@ -1641,17 +1649,6 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
and only the overall execution of the test binary would fail. and only the overall execution of the test binary would fail.
</p> </p>
<p><!-- CL 32455 -->
The signature of the
<a href="/pkg/testing/#MainStart"><code>MainStart</code></a>
function has changed, as allowed by the documentation. It is an
internal detail and not part of the Go 1 compatibility promise.
If you're not calling <code>MainStart</code> directly but see
errors, that likely means you set the
normally-empty <code>GOROOT</code> environment variable and it
doesn't match the version of your <code>go</code> command's binary.
</p>
</dd> </dd>
</dl> </dl>

55
doc/go1.8.txt Normal file
View File

@@ -0,0 +1,55 @@
This file lists things yet to be moved into go1.8.html or deemed too
minor to mention. Either way, delete from here when done.
Tools:
go: -buildmode=c-archive now builds PIC on ELF (CL 24180)
go: mobile pkg dir change, recommend using go list in scripts (CL 24930, CL 27929)
go, dist: can set default pkg-config tool using PKG_CONFIG env var (CL 29991)
go: can set secure/insecure GIT schemes using GIT_ALLOW_PROTOCOL env var (CL 30135)
API additions and behavior changes:
cmd/compile, runtime, etc: get rid of constant FP registers (CL 28095)
cmd/compile, runtime: add go:yeswritebarrierrec pragma (CL 30938)
cmd/compile/internal/gc: enable new parser by default (CL 27203)
cmd/compile/internal/syntax: fast Go syntax trees, initial commit (CL 27195)
cmd/compile: add compiler phase timing (CL 24462)
cmd/compile: add inline explainer (CL 22782)
cmd/compile: enable flag-specified dump of specific phase+function (CL 23044)
cmd/internal/obj, cmd/link: darwin dynlink support (CL 29393)
cmd/internal/objfile: add ppc64/ppc64le disassembler support (CL 9682)
cmd/link, cmd/go: delay linking of mingwex and mingw32 until very end (CL 26670)
cmd/link: R_ADDR dynamic relocs for internal PIE (CL 29118)
cmd/link: add trampolines for too far calls in ppc64x (CL 30850)
cmd/link: allow internal PIE linking (CL 28543)
cmd/link: fix -X importpath.name=value when import path needs escaping (CL 31970)
cmd/link: fix -buildmode=pie / -linkshared combination (CL 28996)
cmd/link: for -buildmode=exe pass -no-pie to external linker (CL 33106)
cmd/link: insert trampolines for too-far jumps on ARM (CL 29397)
cmd/link: non-executable stack support for Solaris (CL 24142)
cmd/link: put text at address 0x1000000 on darwin/amd64 (CL 32185)
cmd/link: remove the -shared flag (CL 28852)
cmd/link: split large elf text sections on ppc64x (CL 27790)
cmd/link: trampoline support for external linking on ARM (CL 31143)
cmd/objdump: implement objdump of .o files (CL 24818)
go/build: allow % in ${SRCDIR} expansion for Jenkins (CL 31611)
go/build: do not record go:binary-only-package if build tags not satisfied (CL 31577)
go/build: implement default GOPATH (CL 32019)
runtime/race: update race runtime (CL 32160)
runtime: assume 64kB physical pages on ARM (CL 25021)
runtime: disable stack rescanning by default (CL 31766)
runtime: don't call cgocallback from signal handler (CL 30218)
runtime: fix check for vacuous page boundary rounding (CL 27230)
runtime: fix map iterator concurrent map check (CL 24749)
runtime: fix newextram PC passed to race detector (CL 29712)
runtime: implement unconditional hybrid barrier (CL 31765)
runtime: include pre-panic/throw logs in core dumps (CL 32013)
runtime: limit the number of map overflow buckets (CL 25049)
runtime: pass windows float syscall args via XMM (CL 32173)
runtime: print sigcode on signal crash (CL 32183)
runtime: record current PC for SIGPROF on non-Go thread (CL 30252)
runtime: sleep on CLOCK_MONOTONIC in futexsleep1 on freebsd (CL 30154)

View File

@@ -1,985 +0,0 @@
<!--{
"Title": "Go 1.9 Release Notes",
"Path": "/doc/go1.9",
"Template": true
}-->
<!--
NOTE: In this document and others in this directory, the convention is to
set fixed-width phrases with non-fixed-width spaces, as in
<code>hello</code> <code>world</code>.
Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.9</h2>
<p><strong>
Go 1.9 is not yet released. These are work-in-progress
release notes. Go 1.9 is expected to be released in August 2017.
</strong></p>
<p>
The latest Go release, version 1.9, arrives six months
after <a href="go1.8">Go 1.8</a> and is the tenth release in
the <a href="https://golang.org/doc/devel/release.html">Go 1.x
series</a>.
There are two <a href="#language">changes to the language</a>:
adding support for type aliases and defining when implementations
may fuse floating point operations.
Most of the changes are in the implementation of the toolchain,
runtime, and libraries.
As always, the release maintains the Go 1
<a href="/doc/go1compat.html">promise of compatibility</a>.
We expect almost all Go programs to continue to compile and run as
before.
</p>
<p>
The release
adds <a href="#monotonic-time">transparent monotonic time support</a>,
<a href="#parallel-compile">parallelizes compilation of functions</a> within a package,
better supports <a href="#test-helper">test helper functions</a>,
includes a new <a href="#math-bits">bit manipulation package</a>,
and has a new <a href="#sync-map">concurrent map type</a>.
</p>
<h2 id="language">Changes to the language</h2>
<p>
There are two changes to the language.
</p>
<p>
Go now supports type aliases to support gradual code repair while
moving a type between packages.
The <a href="https://golang.org/design/18130-type-alias">type alias
design document</a>
and <a href="https://talks.golang.org/2016/refactor.article">an
article on refactoring</a> cover the problem in detail.
In short, a type alias declaration has the form:
</p>
<pre>
type T1 = T2
</pre>
<p>
This declaration introduces an alias name <code>T1</code>—an
alternate spelling—for the type denoted by <code>T2</code>; that is,
both <code>T1</code> and <code>T2</code> denote the same type.
</p>
<p> <!-- CL 40391 -->
A smaller language change is that the
<a href="/ref/spec#Floating_point_operators">language specification
now states</a> when implementations are allowed to fuse floating
point operations together, such as by using an architecture's "fused
multiply and add" (FMA) instruction to compute <code>x*y</code>&nbsp;<code>+</code>&nbsp;<code>z</code>
without rounding the intermediate result <code>x*y</code>.
To force the intermediate rounding, write <code>float64(x*y)</code>&nbsp;<code>+</code>&nbsp;<code>z</code>.
</p>
<h2 id="ports">Ports</h2>
<p>
There are no new supported operating systems or processor
architectures in this release.
</p>
<h3 id="power8">ppc64x requires POWER8</h3>
<p> <!-- CL 36725, CL 36832 -->
Both <code>GOARCH=ppc64</code> and <code>GOARCH=ppc64le</code> now
require at least POWER8 support. In previous releases,
only <code>GOARCH=ppc64le</code> required POWER8 and the big
endian <code>ppc64</code> architecture supported older
hardware.
<p>
<h3 id="freebsd">FreeBSD</h3>
<p>
Go 1.9 is the last release that will run on FreeBSD 9.3,
which is already
<a href="https://www.freebsd.org/security/unsupported.html">unsupported by FreeBSD</a>.
Go 1.10 will require FreeBSD 10.3+.
</p>
<h3 id="openbsd">OpenBSD 6.0</h3>
<p> <!-- CL 40331 -->
Go 1.9 now enables PT_TLS generation for cgo binaries and thus
requires OpenBSD 6.0 or newer. Go 1.9 no longer supports
OpenBSD 5.9.
<p>
<h3 id="known_issues">Known Issues</h3>
<p>
There are some instabilities on FreeBSD that are known but not understood.
These can lead to program crashes in rare cases.
See <a href="https://golang.org/issue/15658">issue 15658</a>.
Any help in solving this FreeBSD-specific issue would be appreciated.
</p>
<p>
Go stopped running NetBSD builders during the Go 1.9 development
cycle due to NetBSD kernel crashes, up to and including NetBSD 7.1.
As Go 1.9 is being released, NetBSD 7.1.1 is being released with a fix.
However, at this time we have no NetBSD builders passing our test suite.
Any help investigating the
<a href="https://github.com/golang/go/labels/OS-NetBSD">various NetBSD issues</a>
would be appreciated.
</p>
<h2 id="tools">Tools</h2>
<h3 id="parallel-compile">Parallel Compilation</h3>
<p>
The Go compiler now supports compiling a package's functions in parallel, taking
advantage of multiple cores. This is in addition to the <code>go</code> command's
existing support for parallel compilation of separate packages.
Parallel compilation is on by default, but it can be disabled by setting the
environment variable <code>GO19CONCURRENTCOMPILATION</code> to <code>0</code>.
</p>
<h3 id="vendor-dotdotdot">Vendor matching with ./...</h3>
<p><!-- CL 38745 -->
By popular request, <code>./...</code> no longer matches packages
in <code>vendor</code> directories in tools accepting package names,
such as <code>go</code> <code>test</code>. To match vendor
directories, write <code>./vendor/...</code>.
</p>
<h3 id="compiler">Compiler Toolchain</h3>
<p><!-- CL 37441 -->
Complex division is now C99-compatible. This has always been the
case in gccgo and is now fixed in the gc toolchain.
</p>
<p> <!-- CL 36983 -->
The linker will now generate DWARF information for cgo executables on Windows.
</p>
<p> <!-- CL 44210, CL 40095 -->
The compiler now includes lexical scopes in the generated DWARF if the
<code>-N -l</code> flags are provided, allowing
debuggers to hide variables that are not in scope. The <code>.debug_info</code>
section is now DWARF version 4.
</p>
<p> <!-- CL 43855 -->
The values of <code>GOARM</code> and <code>GO386</code> now affect a
compiled package's build ID, as used by the <code>go</code> tool's
dependency caching.
</p>
<h3 id="asm">Assembler</h3>
<p> <!-- CL 42028 -->
The four-operand ARM <code>MULA</code> instruction is now assembled correctly,
with the addend register as the third argument and the result
register as the fourth and final argument.
In previous releases, the two meanings were reversed.
The three-operand form, in which the fourth argument is implicitly
the same as the third, is unaffected.
Code using four-operand <code>MULA</code> instructions
will need to be updated, but we believe this form is very rarely used.
<code>MULAWT</code> and <code>MULAWB</code> were already
using the correct order in all forms and are unchanged.
</p>
<p> <!-- CL 42990 -->
The assembler now supports <code>ADDSUBPS/PD</code>, completing the
two missing x86 SSE3 instructions.
</p>
<h3 id="go-doc">Doc</h3>
<p><!-- CL 36031 -->
Long lists of arguments are now truncated. This improves the readability
of <code>go</code> <code>doc</code> on some generated code.
</p>
<p><!-- CL 38438 -->
Viewing documentation on struct fields is now supported.
For example, <code>go</code> <code>doc</code> <code>http.Client.Jar</code>.
</p>
<h3 id="go-env-json">Env</h3>
<p> <!-- CL 38757 -->
The new <code>go</code> <code>env</code> <code>-json</code> flag
enables JSON output, instead of the default OS-specific output
format.
</p>
<h3 id="go-test-list">Test</h3>
<p> <!-- CL 41195 -->
The <a href="/cmd/go/#hdr-Description_of_testing_flags"><code>go</code> <code>test</code></a>
command accepts a new <code>-list</code> flag, which takes a regular
expression as an argument and prints to stdout the name of any
tests, benchmarks, or examples that match it, without running them.
</p>
<h3 id="go-tool-pprof">Pprof</h3>
<p> <!-- CL 34192 -->
Profiles produced by the <code>runtime/pprof</code> package now
include symbol information, so they can be viewed
in <code>go</code> <code>tool</code> <code>pprof</code>
without the binary that produced the profile.
</p>
<p> <!-- CL 38343 -->
The <code>go</code> <code>tool</code> <code>pprof</code> command now
uses the HTTP proxy information defined in the environment, using
<a href="/pkg/net/http/#ProxyFromEnvironment"><code>http.ProxyFromEnvironment</code></a>.
</p>
<h3 id="vet">Vet</h3>
<!-- CL 40112 -->
<p>
The <a href="/cmd/vet/"><code>vet</code> command</a>
has been better integrated into the
<a href="/cmd/go/"><code>go</code> tool</a>,
so <code>go</code> <code>vet</code> now supports all standard build
flags while <code>vet</code>'s own flags are now available
from <code>go</code> <code>vet</code> as well as
from <code>go</code> <code>tool</code> <code>vet</code>.
</p>
<h3 id="gccgo">Gccgo</h3>
<p>
Due to the alignment of Go's semiannual release schedule with GCC's
annual release schedule,
GCC release 7 contains the Go 1.8.3 version of gccgo.
We expect that the next release, GCC 8, will contain the Go 1.10
version of gccgo.
</p>
<h2 id="runtime">Runtime</h2>
<h3 id="callersframes">Call stacks with inlined frames</h3>
<p>
Users of
<a href="/pkg/runtime#Callers"><code>runtime.Callers</code></a>
should avoid directly inspecting the resulting PC slice and instead use
<a href="/pkg/runtime#CallersFrames"><code>runtime.CallersFrames</code></a>
to get a complete view of the call stack, or
<a href="/pkg/runtime#Caller"><code>runtime.Caller</code></a>
to get information about a single caller.
This is because an individual element of the PC slice cannot account
for inlined frames or other nuances of the call stack.
</p>
<p>
Specifically, code that directly iterates over the PC slice and uses
functions such as
<a href="/pkg/runtime#FuncForPC"><code>runtime.FuncForPC</code></a>
to resolve each PC individually will miss inlined frames.
To get a complete view of the stack, such code should instead use
<code>CallersFrames</code>.
Likewise, code should not assume that the length returned by
<code>Callers</code> is any indication of the call depth.
It should instead count the number of frames returned by
<code>CallersFrames</code>.
</p>
<p>
Code that queries a single caller at a specific depth should use
<code>Caller</code> rather than passing a slice of length 1 to
<code>Callers</code>.
</p>
<p>
<a href="/pkg/runtime#CallersFrames"><code>runtime.CallersFrames</code></a>
has been available since Go 1.7, so code can be updated prior to
upgrading to Go 1.9.
</p>
<h2 id="performance">Performance</h2>
<p>
As always, the changes are so general and varied that precise
statements about performance are difficult to make. Most programs
should run a bit faster, due to speedups in the garbage collector,
better generated code, and optimizations in the core library.
</p>
<h3 id="gc">Garbage Collector</h3>
<p> <!-- CL 37520 -->
Library functions that used to trigger stop-the-world garbage
collection now trigger concurrent garbage collection.
Specifically, <a href="/pkg/runtime/#GC"><code>runtime.GC</code></a>,
<a href="/pkg/runtime/debug/#SetGCPercent"><code>debug.SetGCPercent</code></a>,
and
<a href="/pkg/runtime/debug/#FreeOSMemory"><code>debug.FreeOSMemory</code></a>,
now trigger concurrent garbage collection, blocking only the calling
goroutine until the garbage collection is done.
</p>
<p> <!-- CL 34103, CL 39835 -->
The
<a href="/pkg/runtime/debug/#SetGCPercent"><code>debug.SetGCPercent</code></a>
function only triggers a garbage collection if one is immediately
necessary because of the new GOGC value.
This makes it possible to adjust GOGC on-the-fly.
</p>
<p> <!-- CL 38732 -->
Large object allocation performance is significantly improved in
applications using large (&gt;50GB) heaps containing many large
objects.
</p>
<p> <!-- CL 34937 -->
The <a href="/pkg/runtime/#ReadMemStats"><code>runtime.ReadMemStats</code></a>
function now takes less than 100µs even for very large heaps.
</p>
<h2 id="library">Core library</h2>
<h3 id="monotonic-time">Transparent Monotonic Time support</h3>
<p> <!-- CL 36255 -->
The <a href="/pkg/time/"><code>time</code></a> package now transparently
tracks monotonic time in each <a href="/pkg/time/#Time"><code>Time</code></a>
value, making computing durations between two <code>Time</code> values
a safe operation in the presence of wall clock adjustments.
See the <a href="/pkg/time/#hdr-Monotonic_Clocks">package docs</a> and
<a href="https://golang.org/design/12914-monotonic">design document</a>
for details.
</p>
<h3 id="math-bits">New bit manipulation package</h3>
<p> <!-- CL 36315 -->
Go 1.9 includes a new package,
<a href="/pkg/math/bits/"><code>math/bits</code></a>, with optimized
implementations for manipulating bits. On most architectures,
functions in this package are additionally recognized by the
compiler and treated as intrinsics for additional performance.
</p>
<h3 id="test-helper">Test Helper Functions</h3>
<p> <!-- CL 38796 -->
The
new <a href="/pkg/testing/#T.Helper"><code>(*T).Helper</code></a>
and <a href="/pkg/testing/#B.Helper"><code>(*B).Helper</code></a>
methods mark the calling function as a test helper function. When
printing file and line information, that function will be skipped.
This permits writing test helper functions while still having useful
line numbers for users.
</p>
<h3 id="sync-map">Concurrent Map</h3>
<p> <!-- CL 36617 -->
The new <a href="/pkg/sync/#Map"><code>Map</code></a> type
in the <a href="/pkg/sync/"><code>sync</code></a> package
is a concurrent map with amortized-constant-time loads, stores, and
deletes. It is safe for multiple goroutines to call a <code>Map</code>'s methods
concurrently.
</p>
<h3 id="pprof-labels">Profiler Labels</h3>
<p><!-- CL 34198 -->
The <a href="/pkg/runtime/pprof"><code>runtime/pprof</code> package</a>
now supports adding labels to <code>pprof</code> profiler records.
Labels form a key-value map that is used to distinguish calls of the
same function in different contexts when looking at profiles
with the <a href="/cmd/pprof/"><code>pprof</code> command</a>.
The <code>pprof</code> package's
new <a href="/pkg/runtime/pprof/#Do"><code>Do</code> function</a>
runs code associated with some provided labels. Other new functions
in the package help work with labels.
</p>
</dl><!-- runtime/pprof -->
<h3 id="minor_library_changes">Minor changes to the library</h3>
<p>
As always, there are various minor changes and updates to the library,
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
in mind.
</p>
<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
<dd>
<p><!-- CL 39570 -->
The
ZIP <a href="/pkg/archive/zip/#Writer"><code>Writer</code></a>
now sets the UTF-8 bit in
the <a href="/pkg/archive/zip/#FileHeader.Flags"><code>FileHeader.Flags</code></a>
when appropriate.
</p>
</dl><!-- archive/zip -->
<dl id="crypto/rand"><dt><a href="/pkg/crypto/rand/">crypto/rand</a></dt>
<dd>
<p><!-- CL 43852 -->
On Linux, Go now calls the <code>getrandom</code> system call
without the <code>GRND_NONBLOCK</code> flag; it will now block
until the kernel has sufficient randomness. On kernels predating
the <code>getrandom</code> system call, Go continues to read
from <code>/dev/urandom</code>.
</p>
</dl><!-- crypto/rand -->
<dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
<dd>
<p><!-- CL 36093 -->
On Unix systems the environment
variables <code>SSL_CERT_FILE</code>
and <code>SSL_CERT_DIR</code> can now be used to override the
system default locations for the SSL certificate file and SSL
certificate files directory, respectively.
</p>
<p>The FreeBSD file <code>/usr/local/etc/ssl/cert.pem</code> is
now included in the certificate search path.
</p>
<p><!-- CL 36900 -->
The package now supports excluded domains in name constraints.
In addition to enforcing such constraints,
<a href="/pkg/crypto/x509/#CreateCertificate"><code>CreateCertificate</code></a>
will create certificates with excluded name constraints
if the provided template certificate has the new
field
<a href="/pkg/crypto/x509/#Certificate.ExcludedDNSDomains"><code>ExcludedDNSDomains</code></a>
populated.
</p>
</dl><!-- crypto/x509 -->
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
<dd>
<p><!-- CL 35476 -->
The package will now use a cached <a href="/pkg/database/sql/#Stmt"><code>Stmt</code></a> if
available in <a href="/pkg/database/sql/#Tx.Stmt"><code>Tx.Stmt</code></a>.
This prevents statements from being re-prepared each time
<a href="/pkg/database/sql/#Tx.Stmt"><code>Tx.Stmt</code></a> is called.
</p>
<p><!-- CL 38533 -->
The package now allows drivers to implement their own argument checkers by implementing
<a href="/pkg/database/sql/driver/#NamedValueChecker"><code>driver.NamedValueChecker</code></a>.
This also allows drivers to support <code>OUTPUT</code> and <code>INOUT</code> parameter types.
<a href="/pkg/database/sql/#Out"><code>Out</code></a> should be used to return output parameters
when supported by the driver.
</p>
<p><!-- CL 39031 -->
<a href="/pkg/database/sql/#Rows.Scan"><code>Rows.Scan</code></a> can now scan user-defined string types.
Previously the package supported scanning into numeric types like <code>type</code> <code>Int</code> <code>int64</code>. It now also supports
scanning into string types like <code>type</code> <code>String</code> <code>string</code>.
</p>
<p><!-- CL 40694 -->
The new <a href="/pkg/database/sql/#DB.Conn"><code>DB.Conn</code></a> method returns the new
<a href="/pkg/database/sql/#Conn"><code>Conn</code></a> type representing an
exclusive connection to the database from the connection pool. All queries run on
a <a href="/pkg/database/sql/#Conn"><code>Conn</code></a> will use the same underlying
connection until <a href="/pkg/database/sql/#Conn.Close"><code>Conn.Close</code></a> is called
to return the connection to the connection pool.
</p>
</dl><!-- database/sql -->
<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
<dd>
<p><!-- CL 38660 -->
The new
<a href="/pkg/encoding/asn1/#NullBytes"><code>NullBytes</code></a>
and
<a href="/pkg/encoding/asn1/#NullRawValue"><code>NullRawValue</code></a>
represent the ASN.1 NULL type.
</p>
</dl><!-- encoding/asn1 -->
<dl id="encoding/base32"><dt><a href="/pkg/encoding/base32/">encoding/base32</a></dt>
<dd>
<p><!-- CL 38634 -->
The new <a href="/pkg/encoding/base32/#Encoding.WithPadding">Encoding.WithPadding</a>
method adds support for custom padding characters and disabling padding.
</p>
</dl><!-- encoding/base32 -->
<dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
<dd>
<p><!-- CL 41730 -->
The new field
<a href="/pkg/encoding/csv/#Reader.ReuseRecord"><code>Reader.ReuseRecord</code></a>
controls whether calls to
<a href="/pkg/encoding/csv/#Reader.Read"><code>Read</code></a>
may return a slice sharing the backing array of the previous
call's returned slice for improved performance.
</p>
</dl><!-- encoding/csv -->
<dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
<dd>
<p><!-- CL 37051 -->
The sharp flag ('<code>#</code>') is now supported when printing
floating point and complex numbers. It will always print a
decimal point
for <code>%e</code>, <code>%E</code>, <code>%f</code>, <code>%F</code>, <code>%g</code>
and <code>%G</code>; it will not remove trailing zeros
for <code>%g</code> and <code>%G</code>.
</p>
</dl><!-- fmt -->
<dl id="hash/fnv"><dt><a href="/pkg/hash/fnv/">hash/fnv</a></dt>
<dd>
<p><!-- CL 38356 -->
The package now includes 128-bit FNV-1 and FNV-1a hash support with
<a href="/pkg/hash/fnv/#New128"><code>New128</code></a> and
<a href="/pkg/hash/fnv/#New128a"><code>New128a</code></a>, respectively.
</p>
</dl><!-- hash/fnv -->
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
<dd>
<p><!-- CL 37880, CL 40936 -->
The package now reports an error if a predefined escaper (one of
"html", "urlquery" and "js") is found in a pipeline and does not match
what the auto-escaper would have decided on its own.
This avoids certain security or correctness issues.
Now use of one of these escapers is always either a no-op or an error.
(The no-op case eases migration from <a href="/pkg/text/template/">text/template</a>.)
</p>
</dl><!-- html/template -->
<dl id="image"><dt><a href="/pkg/image/">image</a></dt>
<dd>
<p><!-- CL 36734 -->
The <a href="/pkg/image/#Rectangle.Intersect"><code>Rectangle.Intersect</code></a>
method now returns a zero <code>Rectangle</code> when called on
adjacent but non-overlapping rectangles, as documented. In
earlier releases it would incorrectly return an empty but
non-zero <code>Rectangle</code>.
</p>
</dl><!-- image -->
<dl id="image/color"><dt><a href="/pkg/image/color/">image/color</a></dt>
<dd>
<p><!-- CL 36732 -->
The YCbCr to RGBA conversion formula has been tweaked to ensure
that rounding adjustments span the complete [0, 0xffff] RGBA
range.
</p>
</dl><!-- image/color -->
<dl id="image/png"><dt><a href="/pkg/image/png/">image/png</a></dt>
<dd>
<p><!-- CL 34150 -->
The new <a href="/pkg/image/png/#Encoder.BufferPool"><code>Encoder.BufferPool</code></a>
field allows specifying an <a href="/pkg/image/png/#EncoderBufferPool"><code>EncoderBufferPool</code></a>,
that will be used by the encoder to get temporary <code>EncoderBuffer</code>
buffers when encoding a PNG image.
The use of a <code>BufferPool</code> reduces the number of
memory allocations performed while encoding multiple images.
</p>
<p><!-- CL 38271 -->
The package now supports the decoding of transparent 8-bit
grayscale ("Gray8") images.
</p>
</dl><!-- image/png -->
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
<dd>
<p><!-- CL 36487 -->
The new
<a href="/pkg/math/big/#Int.IsInt64"><code>IsInt64</code></a>
and
<a href="/pkg/math/big/#Int.IsUint64"><code>IsUint64</code></a>
methods report whether an <code>Int</code>
may be represented as an <code>int64</code> or <code>uint64</code>
value.
</p>
</dl><!-- math/big -->
<dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
<dd>
<p><!-- CL 39223 -->
The new
<a href="/pkg/mime/multipart/#FileHeader.Size"><code>FileHeader.Size</code></a>
field describes the size of a file in a multipart message.
</p>
</dl><!-- mime/multipart -->
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
<dd>
<p><!-- CL 32572 -->
The new
<a href="/pkg/net/#Resolver.StrictErrors"><code>Resolver.StrictErrors</code></a>
provides control over how Go's built-in DNS resolver handles
temporary errors during queries composed of multiple sub-queries,
such as an A+AAAA address lookup.
</p>
<p><!-- CL 37260 -->
The new
<a href="/pkg/net/#Resolver.Dial"><code>Resolver.Dial</code></a>
allows a <code>Resolver</code> to use a custom dial function.
</p>
<p><!-- CL 40510 -->
<a href="/pkg/net/#JoinHostPort"><code>JoinHostPort</code></a> now only places an address in square brackets if the host contains a colon.
In previous releases it would also wrap addresses in square brackets if they contained a percent ('<code>%</code>') sign.
</p>
<p><!-- CL 37913 -->
The new methods
<a href="/pkg/net/#TCPConn.SyscallConn"><code>TCPConn.SyscallConn</code></a>,
<a href="/pkg/net/#IPConn.SyscallConn"><code>IPConn.SyscallConn</code></a>,
<a href="/pkg/net/#UDPConn.SyscallConn"><code>UDPConn.SyscallConn</code></a>,
and
<a href="/pkg/net/#UnixConn.SyscallConn"><code>UnixConn.SyscallConn</code></a>
provide access to the connections' underlying file descriptors.
</p>
<p><!-- 45088 -->
It is now safe to call <a href="/pkg/net/#Dial"><code>Dial</code></a> with the address obtained from
<code>(*TCPListener).String()</code> after creating the listener with
<code><a href="/pkg/net/#Listen">Listen</a>("tcp", ":0")</code>.
Previously it failed on some machines with half-configured IPv6 stacks.
</p>
</dl><!-- net -->
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
<dd>
<p><!-- CL 37328 -->
The <a href="/pkg/net/http/#Cookie.String"><code>Cookie.String</code></a> method, used for
<code>Cookie</code> and <code>Set-Cookie</code> headers, now encloses values in double quotes
if the value contains either a space or a comma.
</p>
<p>Server changes:</p>
<ul>
<li><!-- CL 38194 -->
<a href="/pkg/net/http/#ServeMux"><code>ServeMux</code></a> now ignores ports in the host
header when matching handlers. The host is matched unmodified for <code>CONNECT</code> requests.
</li>
<li><!-- CL 34727 -->
<a href="/pkg/net/http/#Server.WriteTimeout"><code>Server.WriteTimeout</code></a>
now applies to HTTP/2 connections and is enforced per-stream.
</li>
<li><!-- CL 43231 -->
HTTP/2 now uses the priority write scheduler by default.
Frames are scheduled by following HTTP/2 priorities as described in
<a href="https://tools.ietf.org/html/rfc7540#section-5.3">RFC 7540 Section 5.3</a>.
</li>
<li><!-- CL 36483 -->
The HTTP handler returned by <a href="/pkg/net/http/#StripPrefix"><code>StripPrefix</code></a>
now calls its provided handler with a modified clone of the original <code>*http.Request</code>.
Any code storing per-request state in maps keyed by <code>*http.Request</code> should
use
<a href="/pkg/net/http/#Request.Context"><code>Request.Context</code></a>,
<a href="/pkg/net/http/#Request.WithContext"><code>Request.WithContext</code></a>,
and
<a href="/pkg/context/#WithValue"><code>context.WithValue</code></a> instead.
</li>
</ul>
<p>Client &amp; Transport changes:</p>
<ul>
<li><!-- CL 35488 -->
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
now supports making requests via SOCKS5 proxy when the URL returned by
<a href="/net/http/#Transport.Proxy"><code>Transport.Proxy</code></a>
has the scheme <code>socks5</code>.
</li>
</ul>
</dl><!-- net/http -->
<dl id="net/http/fcgi"><dt><a href="/pkg/net/http/fcgi/">net/http/fcgi</a></dt>
<dd>
<p><!-- CL 40012 -->
The new
<a href="/pkg/net/http/fcgi/#ProcessEnv"><code>ProcessEnv</code></a>
function returns FastCGI environment variables associated with an HTTP request
for which there are no appropriate
<a href="/pkg/net/http/#Request"><code>http.Request</code></a>
fields, such as <code>REMOTE_USER</code>.
</p>
</dl><!-- net/http/fcgi -->
<dl id="net/http/httptest"><dt><a href="/pkg/net/http/httptest/">net/http/httptest</a></dt>
<dd>
<p><!-- CL 34639 -->
The new
<a href="/pkg/net/http/httptest/#Server.Client"><code>Server.Client</code></a>
method returns an HTTP client configured for making requests to the test server.
</p>
<p>
The new
<a href="/pkg/net/http/httptest/#Server.Certificate"><code>Server.Certificate</code></a>
method returns the test server's TLS certificate, if any.
</p>
</dl><!-- net/http/httptest -->
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
<dd>
<p><!-- CL 36800 -->
The <code>os</code> package now uses the internal runtime poller
for file I/O.
This reduces the number of threads required for read/write
operations on pipes, and it eliminates races when one goroutine
closes a file while another is using the file for I/O.
</p>
<dd>
<p><!-- CL 37915 -->
On Windows,
<a href="/pkg/os/#Args"><code>Args</code></a>
is now populated without <code>shell32.dll</code>, improving process start-up time by 1-7 ms.
</p>
</dl><!-- os -->
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
<dd>
<p><!-- CL 37586 -->
The <code>os/exec</code> package now prevents child processes from being created with
any duplicate environment variables.
If <a href="/pkg/os/exec/#Cmd.Env"><code>Cmd.Env</code></a>
contains duplicate environment keys, only the last
value in the slice for each duplicate key is used.
</p>
</dl><!-- os/exec -->
<dl id="os/user"><dt><a href="/pkg/os/user/">os/user</a></dt>
<dd>
<p><!-- CL 37664 -->
<a href="/pkg/os/user/#Lookup"><code>Lookup</code></a> and
<a href="/pkg/os/user/#LookupId"><code>LookupId</code></a> now
work on Unix systems when <code>CGO_ENABLED=0</code> by reading
the <code>/etc/passwd</code> file.
</p>
<p><!-- CL 33713 -->
<a href="/pkg/os/user/#LookupGroup"><code>LookupGroup</code></a> and
<a href="/pkg/os/user/#LookupGroupId"><code>LookupGroupId</code></a> now
work on Unix systems when <code>CGO_ENABLED=0</code> by reading
the <code>/etc/group</code> file.
</p>
</dl><!-- os/user -->
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
<dd>
<p><!-- CL 38335 -->
The new
<a href="/pkg/reflect/#MakeMapWithSize"><code>MakeMapWithSize</code></a>
function creates a map with a capacity hint.
</p>
</dl><!-- reflect -->
<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
<dd>
<p><!-- CL 37233, CL 37726 -->
Tracebacks generated by the runtime and recorded in profiles are
now accurate in the presence of inlining.
To retrieve tracebacks programmatically, applications should use
<a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
rather than directly iterating over the results of
<a href="/pkg/runtime/#Callers"><code>runtime.Callers</code></a>.
</p>
<p><!-- CL 38403 -->
On Windows, Go no longer forces the system timer to run at high
resolution when the program is idle.
This should reduce the impact of Go programs on battery life.
</p>
<p><!-- CL 29341 -->
On FreeBSD, <code>GOMAXPROCS</code> and
<a href="/pkg/runtime/#NumCPU"><code>runtime.NumCPU</code></a>
are now based on the process' CPU mask, rather than the total
number of CPUs.
</p>
<p><!-- CL 43641 -->
The runtime has preliminary support for Android O.
</p>
</dl><!-- runtime -->
<dl id="runtime/debug"><dt><a href="/pkg/runtime/debug/">runtime/debug</a></dt>
<dd>
<p><!-- CL 34013 -->
Calling
<a href="/pkg/runtime/debug/#SetGCPercent"><code>SetGCPercent</code></a>
with a negative value no longer runs an immediate garbage collection.
</p>
</dl><!-- runtime/debug -->
<dl id="runtime/trace"><dt><a href="/pkg/runtime/trace/">runtime/trace</a></dt>
<dd>
<p><!-- CL 36015 -->
The execution trace now displays mark assist events, which
indicate when an application goroutine is forced to assist
garbage collection because it is allocating too quickly.
</p>
<p><!-- CL 40810 -->
"Sweep" events now encompass the entire process of finding free
space for an allocation, rather than recording each individual
span that is swept.
This reduces allocation latency when tracing allocation-heavy
programs.
The sweep event shows how many bytes were swept and how many
were reclaimed.
</p>
</dl><!-- runtime/trace -->
<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
<dd>
<p><!-- CL 34310 -->
<a href="/pkg/sync/#Mutex"><code>Mutex</code></a> is now more fair.
</p>
</dl><!-- sync -->
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
<dd>
<p><!-- CL 36697 -->
The new field
<a href="/pkg/syscall/#Credential.NoSetGroups"><code>Credential.NoSetGroups</code></a>
controls whether Unix systems make a <code>setgroups</code> system call
to set supplementary groups when starting a new process.
</p>
<p><!-- CL 43512 -->
The new field
<a href="/pkg/syscall/#SysProcAttr.AmbientCaps"><code>SysProcAttr.AmbientCaps</code></a>
allows setting ambient capabilities on Linux 4.3+ when creating
a new process.
</p>
<p><!-- CL 37439 -->
On 64-bit x86 Linux, process creation latency has been optimized with
use of <code>CLONE_VFORK</code> and <code>CLONE_VM</code>.
</p>
<p><!-- CL 37913 -->
The new
<a href="/pkg/syscall/#Conn"><code>Conn</code></a>
interface describes some types in the
<a href="/pkg/net/"><code>net</code></a>
package that can provide access to their underlying file descriptor
using the new
<a href="/pkg/syscall/#RawConn"><code>RawConn</code></a>
interface.
</p>
</dl><!-- syscall -->
<dl id="testing/quick"><dt><a href="/pkg/testing/quick/">testing/quick</a></dt>
<dd>
<p><!-- CL 39152 -->
The package now chooses values in the full range when
generating <code>int64</code> and <code>uint64</code> random
numbers; in earlier releases generated values were always
limited to the [-2<sup>62</sup>, 2<sup>62</sup>) range.
</p>
<p>
In previous releases, using a nil
<a href="/pkg/testing/quick/#Config.Rand"><code>Config.Rand</code></a>
value caused a fixed deterministic random number generator to be used.
It now uses a random number generator seeded with the current time.
For the old behavior, set <code>Config.Rand</code> to <code>rand.New(rand.NewSource(0))</code>.
</p>
</dl><!-- testing/quick -->
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
<dd>
<p><!-- CL 38420 -->
The handling of empty blocks, which was broken by a Go 1.8
change that made the result dependent on the order of templates,
has been fixed, restoring the old Go 1.7 behavior.
</p>
</dl><!-- text/template -->
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
<dd>
<p><!-- CL 36615 -->
The new methods
<a href="/pkg/time/#Duration.Round"><code>Duration.Round</code></a>
and
<a href="/pkg/time/#Duration.Truncate"><code>Duration.Truncate</code></a>
handle rounding and truncating durations to multiples of a given duration.
</p>
<p><!-- CL 35710 -->
Retrieving the time and sleeping now work correctly under Wine.
</p>
<p>
If a <code>Time</code> value has a monotonic clock reading, its
string representation (as returned by <code>String</code>) now includes a
final field <code>"m=±value"</code>, where <code>value</code> is the
monotonic clock reading formatted as a decimal number of seconds.
</p>
<p><!-- CL 44832 -->
The included <code>tzdata</code> timezone database has been
updated to version 2017b. As always, it is only used if the
system does not already have the database available.
</p>
</dl><!-- time -->

View File

@@ -1140,7 +1140,7 @@ program is one tool to help automate this process.
</p> </p>
<p> <p>
The Go 1.5 release added a facility to the The Go 1.5 release includes an experimental facility to the
<a href="https://golang.org/cmd/go">go</a> command <a href="https://golang.org/cmd/go">go</a> command
that makes it easier to manage external dependencies by "vendoring" that makes it easier to manage external dependencies by "vendoring"
them into a special directory near the package that depends upon them. them into a special directory near the package that depends upon them.
@@ -1148,13 +1148,6 @@ See the <a href="https://golang.org/s/go15vendor">design
document</a> for details. document</a> for details.
</p> </p>
<p>
Work is underway on an experimental package management tool,
<a href="https://github.com/golang/dep"><code>dep</code></a>, to learn
more about how tooling can help package management. More information can be found in
<a href="https://github.com/golang/dep/blob/master/FAQ.md">the <code>dep</code> FAQ</a>.
</p>
<h2 id="Pointers">Pointers and Allocation</h2> <h2 id="Pointers">Pointers and Allocation</h2>
<h3 id="pass_by_value"> <h3 id="pass_by_value">

View File

@@ -1,6 +1,6 @@
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of June 28, 2017", "Subtitle": "Version of November 18, 2016",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
@@ -154,7 +154,7 @@ Any other comment acts like a newline.
<p> <p>
Tokens form the vocabulary of the Go language. Tokens form the vocabulary of the Go language.
There are four classes: <i>identifiers</i>, <i>keywords</i>, <i>operators There are four classes: <i>identifiers</i>, <i>keywords</i>, <i>operators
and punctuation</i>, and <i>literals</i>. <i>White space</i>, formed from and delimiters</i>, and <i>literals</i>. <i>White space</i>, formed from
spaces (U+0020), horizontal tabs (U+0009), spaces (U+0020), horizontal tabs (U+0009),
carriage returns (U+000D), and newlines (U+000A), carriage returns (U+000D), and newlines (U+000A),
is ignored except as it separates tokens is ignored except as it separates tokens
@@ -197,7 +197,7 @@ into the token stream immediately after a line's final token if that token is
<code>return</code> <code>return</code>
</li> </li>
<li>one of the <a href="#Operators_and_punctuation">operators and punctuation</a> <li>one of the <a href="#Operators_and_Delimiters">operators and delimiters</a>
<code>++</code>, <code>++</code>,
<code>--</code>, <code>--</code>,
<code>)</code>, <code>)</code>,
@@ -254,11 +254,10 @@ const fallthrough if range type
continue for import return var continue for import return var
</pre> </pre>
<h3 id="Operators_and_punctuation">Operators and punctuation</h3> <h3 id="Operators_and_Delimiters">Operators and Delimiters</h3>
<p> <p>
The following character sequences represent <a href="#Operators">operators</a> The following character sequences represent <a href="#Operators">operators</a>, delimiters, and other special tokens:
(including <a href="#assign_op">assignment operators</a>) and punctuation:
</p> </p>
<pre class="grammar"> <pre class="grammar">
+ &amp; += &amp;= &amp;&amp; == != ( ) + &amp; += &amp;= &amp;&amp; == != ( )
@@ -686,9 +685,11 @@ If a variable has not yet been assigned a value, its value is the
<h2 id="Types">Types</h2> <h2 id="Types">Types</h2>
<p> <p>
A type determines a set of values together with operations and methods specific A type determines the set of values and operations specific to values of that
to those values. A type may be denoted by a <i>type name</i>, if it has one, type. Types may be <i>named</i> or <i>unnamed</i>. Named types are specified
or specified using a <i>type literal</i>, which composes a type from existing types. by a (possibly <a href="#Qualified_identifiers">qualified</a>)
<a href="#Type_declarations"><i>type name</i></a>; unnamed types are specified
using a <i>type literal</i>, which composes a new type from existing types.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
@@ -701,7 +702,6 @@ TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType
<p> <p>
Named instances of the boolean, numeric, and string types are Named instances of the boolean, numeric, and string types are
<a href="#Predeclared_identifiers">predeclared</a>. <a href="#Predeclared_identifiers">predeclared</a>.
Other named types are introduced with <a href="#Type_declarations">type declarations</a>.
<i>Composite types</i>&mdash;array, struct, pointer, function, <i>Composite types</i>&mdash;array, struct, pointer, function,
interface, slice, map, and channel types&mdash;may be constructed using interface, slice, map, and channel types&mdash;may be constructed using
type literals. type literals.
@@ -717,23 +717,16 @@ is the underlying type of the type to which <code>T</code> refers in its
</p> </p>
<pre> <pre>
type ( type T1 string
A1 = string type T2 T1
A2 = A1 type T3 []T1
) type T4 T3
type (
B1 string
B2 B1
B3 []B1
B4 B3
)
</pre> </pre>
<p> <p>
The underlying type of <code>string</code>, <code>A1</code>, <code>A2</code>, <code>B1</code>, The underlying type of <code>string</code>, <code>T1</code>, and <code>T2</code>
and <code>B2</code> is <code>string</code>. is <code>string</code>. The underlying type of <code>[]T1</code>, <code>T3</code>,
The underlying type of <code>[]B1</code>, <code>B3</code>, and <code>B4</code> is <code>[]B1</code>. and <code>T4</code> is <code>[]T1</code>.
</p> </p>
<h3 id="Method_sets">Method sets</h3> <h3 id="Method_sets">Method sets</h3>
@@ -745,7 +738,7 @@ The method set of any other type <code>T</code> consists of all
The method set of the corresponding <a href="#Pointer_types">pointer type</a> <code>*T</code> The method set of the corresponding <a href="#Pointer_types">pointer type</a> <code>*T</code>
is the set of all methods declared with receiver <code>*T</code> or <code>T</code> is the set of all methods declared with receiver <code>*T</code> or <code>T</code>
(that is, it also contains the method set of <code>T</code>). (that is, it also contains the method set of <code>T</code>).
Further rules apply to structs containing embedded fields, as described Further rules apply to structs containing anonymous fields, as described
in the section on <a href="#Struct_types">struct types</a>. in the section on <a href="#Struct_types">struct types</a>.
Any other type has an empty method set. Any other type has an empty method set.
In a method set, each method must have a In a method set, each method must have a
@@ -954,16 +947,16 @@ Moreover, the inner slices must be initialized individually.
<p> <p>
A struct is a sequence of named elements, called fields, each of which has a A struct is a sequence of named elements, called fields, each of which has a
name and a type. Field names may be specified explicitly (IdentifierList) or name and a type. Field names may be specified explicitly (IdentifierList) or
implicitly (EmbeddedField). implicitly (AnonymousField).
Within a struct, non-<a href="#Blank_identifier">blank</a> field names must Within a struct, non-<a href="#Blank_identifier">blank</a> field names must
be <a href="#Uniqueness_of_identifiers">unique</a>. be <a href="#Uniqueness_of_identifiers">unique</a>.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
StructType = "struct" "{" { FieldDecl ";" } "}" . StructType = "struct" "{" { FieldDecl ";" } "}" .
FieldDecl = (IdentifierList Type | EmbeddedField) [ Tag ] . FieldDecl = (IdentifierList Type | AnonymousField) [ Tag ] .
EmbeddedField = [ "*" ] TypeName . AnonymousField = [ "*" ] TypeName .
Tag = string_lit . Tag = string_lit .
</pre> </pre>
<pre> <pre>
@@ -981,15 +974,16 @@ struct {
</pre> </pre>
<p> <p>
A field declared with a type but no explicit field name is called an <i>embedded field</i>. A field declared with a type but no explicit field name is an <i>anonymous field</i>,
An embedded field must be specified as also called an <i>embedded</i> field or an embedding of the type in the struct.
An embedded type must be specified as
a type name <code>T</code> or as a pointer to a non-interface type name <code>*T</code>, a type name <code>T</code> or as a pointer to a non-interface type name <code>*T</code>,
and <code>T</code> itself may not be and <code>T</code> itself may not be
a pointer type. The unqualified type name acts as the field name. a pointer type. The unqualified type name acts as the field name.
</p> </p>
<pre> <pre>
// A struct with four embedded fields of types T1, *T2, P.T3 and *P.T4 // A struct with four anonymous fields of type T1, *T2, P.T3 and *P.T4
struct { struct {
T1 // field name is T1 T1 // field name is T1
*T2 // field name is T2 *T2 // field name is T2
@@ -1006,15 +1000,15 @@ in a struct type:
<pre> <pre>
struct { struct {
T // conflicts with embedded field *T and *P.T T // conflicts with anonymous field *T and *P.T
*T // conflicts with embedded field T and *P.T *T // conflicts with anonymous field T and *P.T
*P.T // conflicts with embedded field T and *T *P.T // conflicts with anonymous field T and *T
} }
</pre> </pre>
<p> <p>
A field or <a href="#Method_declarations">method</a> <code>f</code> of an A field or <a href="#Method_declarations">method</a> <code>f</code> of an
embedded field in a struct <code>x</code> is called <i>promoted</i> if anonymous field in a struct <code>x</code> is called <i>promoted</i> if
<code>x.f</code> is a legal <a href="#Selectors">selector</a> that denotes <code>x.f</code> is a legal <a href="#Selectors">selector</a> that denotes
that field or method <code>f</code>. that field or method <code>f</code>.
</p> </p>
@@ -1031,7 +1025,7 @@ promoted methods are included in the method set of the struct as follows:
</p> </p>
<ul> <ul>
<li> <li>
If <code>S</code> contains an embedded field <code>T</code>, If <code>S</code> contains an anonymous field <code>T</code>,
the <a href="#Method_sets">method sets</a> of <code>S</code> the <a href="#Method_sets">method sets</a> of <code>S</code>
and <code>*S</code> both include promoted methods with receiver and <code>*S</code> both include promoted methods with receiver
<code>T</code>. The method set of <code>*S</code> also <code>T</code>. The method set of <code>*S</code> also
@@ -1039,7 +1033,7 @@ promoted methods are included in the method set of the struct as follows:
</li> </li>
<li> <li>
If <code>S</code> contains an embedded field <code>*T</code>, If <code>S</code> contains an anonymous field <code>*T</code>,
the method sets of <code>S</code> and <code>*S</code> both the method sets of <code>S</code> and <code>*S</code> both
include promoted methods with receiver <code>T</code> or include promoted methods with receiver <code>T</code> or
<code>*T</code>. <code>*T</code>.
@@ -1424,10 +1418,11 @@ Two types are either <i>identical</i> or <i>different</i>.
</p> </p>
<p> <p>
A <a href="#Type_definitions">defined type</a> is always different from any other type. Two <a href="#Types">named types</a> are identical if their type names originate in the same
Otherwise, two types are identical if their <a href="#Types">underlying</a> type literals are <a href="#Type_declarations">TypeSpec</a>.
structurally equivalent; that is, they have the same literal structure and corresponding A named and an <a href="#Types">unnamed type</a> are always different. Two unnamed types are identical
components have identical types. In detail: if the corresponding type literals are identical, that is, if they have the same
literal structure and corresponding components have identical types. In detail:
</p> </p>
<ul> <ul>
@@ -1439,8 +1434,8 @@ components have identical types. In detail:
<li>Two struct types are identical if they have the same sequence of fields, <li>Two struct types are identical if they have the same sequence of fields,
and if corresponding fields have the same names, and identical types, and if corresponding fields have the same names, and identical types,
and identical tags. and identical tags.
<a href="#Exported_identifiers">Non-exported</a> field names from different Two anonymous fields are considered to have the same name. Lower-case field
packages are always different.</li> names from different packages are always different.</li>
<li>Two pointer types are identical if they have identical base types.</li> <li>Two pointer types are identical if they have identical base types.</li>
@@ -1450,9 +1445,8 @@ components have identical types. In detail:
Parameter and result names are not required to match.</li> Parameter and result names are not required to match.</li>
<li>Two interface types are identical if they have the same set of methods <li>Two interface types are identical if they have the same set of methods
with the same names and identical function types. with the same names and identical function types. Lower-case method names from
<a href="#Exported_identifiers">Non-exported</a> method names from different different packages are always different. The order of the methods is irrelevant.</li>
packages are always different. The order of the methods is irrelevant.</li>
<li>Two map types are identical if they have identical key and value types.</li> <li>Two map types are identical if they have identical key and value types.</li>
@@ -1466,24 +1460,13 @@ Given the declarations
<pre> <pre>
type ( type (
A0 = []string T0 []string
A1 = A0 T1 []string
A2 = struct{ a, b int } T2 struct{ a, b int }
A3 = int T3 struct{ a, c int }
A4 = func(A3, float64) *A0 T4 func(int, float64) *T0
A5 = func(x int, _ float64) *[]string T5 func(x int, y float64) *[]string
) )
type (
B0 A0
B1 []string
B2 struct{ a, b int }
B3 struct{ a, c int }
B4 func(int, float64) *B0
B5 func(x int, y float64) *A1
)
type C0 = B0
</pre> </pre>
<p> <p>
@@ -1491,22 +1474,17 @@ these types are identical:
</p> </p>
<pre> <pre>
A0, A1, and []string T0 and T0
A2 and struct{ a, b int }
A3 and int
A4, func(int, float64) *[]string, and A5
B0, B0, and C0
[]int and []int []int and []int
struct{ a, b *T5 } and struct{ a, b *T5 } struct{ a, b *T5 } and struct{ a, b *T5 }
func(x int, y float64) *[]string, func(int, float64) (result *[]string), and A5 func(x int, y float64) *[]string and func(int, float64) (result *[]string)
</pre> </pre>
<p> <p>
<code>B0</code> and <code>B1</code> are different because they are new types <code>T0</code> and <code>T1</code> are different because they are named types
created by distinct <a href="#Type_definitions">type definitions</a>; with distinct declarations; <code>func(int, float64) *T0</code> and
<code>func(int, float64) *B0</code> and <code>func(x int, y float64) *[]string</code> <code>func(x int, y float64) *[]string</code> are different because <code>T0</code>
are different because <code>B0</code> is different from <code>[]string</code>. is different from <code>[]string</code>.
</p> </p>
@@ -1524,7 +1502,7 @@ A value <code>x</code> is <i>assignable</i> to a <a href="#Variables">variable</
<li> <li>
<code>x</code>'s type <code>V</code> and <code>T</code> have identical <code>x</code>'s type <code>V</code> and <code>T</code> have identical
<a href="#Types">underlying types</a> and at least one of <code>V</code> <a href="#Types">underlying types</a> and at least one of <code>V</code>
or <code>T</code> is not a <a href="#Type_definitions">defined</a> type. or <code>T</code> is not a <a href="#Types">named type</a>.
</li> </li>
<li> <li>
<code>T</code> is an interface type and <code>T</code> is an interface type and
@@ -1533,7 +1511,7 @@ or <code>T</code> is not a <a href="#Type_definitions">defined</a> type.
<li> <li>
<code>x</code> is a bidirectional channel value, <code>T</code> is a channel type, <code>x</code> is a bidirectional channel value, <code>T</code> is a channel type,
<code>x</code>'s type <code>V</code> and <code>T</code> have identical element types, <code>x</code>'s type <code>V</code> and <code>T</code> have identical element types,
and at least one of <code>V</code> or <code>T</code> is not a defined type. and at least one of <code>V</code> or <code>T</code> is not a named type.
</li> </li>
<li> <li>
<code>x</code> is the predeclared identifier <code>nil</code> and <code>T</code> <code>x</code> is the predeclared identifier <code>nil</code> and <code>T</code>
@@ -1862,60 +1840,23 @@ last non-empty expression list.
<h3 id="Type_declarations">Type declarations</h3> <h3 id="Type_declarations">Type declarations</h3>
<p> <p>
A type declaration binds an identifier, the <i>type name</i>, to a <a href="#Types">type</a>. A type declaration binds an identifier, the <i>type name</i>, to a new type
Type declarations come in two forms: alias declarations and type definitions. that has the same <a href="#Types">underlying type</a> as an existing type,
<p> and operations defined for the existing type are also defined for the new type.
The new type is <a href="#Type_identity">different</a> from the existing type.
<pre class="ebnf">
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
TypeSpec = AliasDecl | TypeDef .
</pre>
<h4 id="Alias_declarations">Alias declarations</h4>
<p>
An alias declaration binds an identifier to the given type.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
AliasDecl = identifier "=" Type . TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
TypeSpec = identifier Type .
</pre> </pre>
<p>
Within the <a href="#Declarations_and_scope">scope</a> of
the identifier, it serves as an <i>alias</i> for the type.
</p>
<pre> <pre>
type IntArray [16]int
type ( type (
nodeList = []*Node // nodeList and []*Node are identical types Point struct{ x, y float64 }
Polar = polar // Polar and polar denote identical types Polar Point
)
</pre>
<h4 id="Type_definitions">Type definitions</h4>
<p>
A type definition creates a new, distinct type with the same
<a href="#Types">underlying type</a> and operations as the given type,
and binds an identifier to it.
</p>
<pre class="ebnf">
TypeDef = identifier Type .
</pre>
<p>
The new type is called a <i>defined type</i>.
It is <a href="#Type_identity">different</a> from any other type,
including the type it is created from.
</p>
<pre>
type (
Point struct{ x, y float64 } // Point and struct{ x, y float64 } are different types
polar Point // polar and Point denote different types
) )
type TreeNode struct { type TreeNode struct {
@@ -1931,9 +1872,8 @@ type Block interface {
</pre> </pre>
<p> <p>
A defined type may have <a href="#Method_declarations">methods</a> associated with it. The declared type does not inherit any <a href="#Method_declarations">methods</a>
It does not inherit any methods bound to the given type, bound to the existing type, but the <a href="#Method_sets">method set</a>
but the <a href="#Method_sets">method set</a>
of an interface type or of elements of a composite type remains unchanged: of an interface type or of elements of a composite type remains unchanged:
</p> </p>
@@ -1951,7 +1891,7 @@ type NewMutex Mutex
type PtrMutex *Mutex type PtrMutex *Mutex
// The method set of *PrintableMutex contains the methods // The method set of *PrintableMutex contains the methods
// Lock and Unlock bound to its embedded field Mutex. // Lock and Unlock bound to its anonymous field Mutex.
type PrintableMutex struct { type PrintableMutex struct {
Mutex Mutex
} }
@@ -1961,8 +1901,8 @@ type MyBlock Block
</pre> </pre>
<p> <p>
Type definitions may be used to define different boolean, numeric, A type declaration may be used to define a different boolean, numeric, or string
or string types and associate methods with them: type and attach methods to it:
</p> </p>
<pre> <pre>
@@ -1984,8 +1924,8 @@ func (tz TimeZone) String() string {
<h3 id="Variable_declarations">Variable declarations</h3> <h3 id="Variable_declarations">Variable declarations</h3>
<p> <p>
A variable declaration creates one or more <a href="#Variables">variables</a>, A variable declaration creates one or more variables, binds corresponding
binds corresponding identifiers to them, and gives each a type and an initial value. identifiers to them, and gives each a type and an initial value.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
@@ -2143,8 +2083,8 @@ and associates the method with the receiver's <i>base type</i>.
</p> </p>
<pre class="ebnf"> <pre class="ebnf">
MethodDecl = "func" Receiver MethodName ( Function | Signature ) . MethodDecl = "func" Receiver MethodName ( Function | Signature ) .
Receiver = Parameters . Receiver = Parameters .
</pre> </pre>
<p> <p>
@@ -2153,7 +2093,7 @@ name. That parameter section must declare a single non-variadic parameter, the r
Its type must be of the form <code>T</code> or <code>*T</code> (possibly using Its type must be of the form <code>T</code> or <code>*T</code> (possibly using
parentheses) where <code>T</code> is a type name. The type denoted by <code>T</code> is called parentheses) where <code>T</code> is a type name. The type denoted by <code>T</code> is called
the receiver <i>base type</i>; it must not be a pointer or interface type and the receiver <i>base type</i>; it must not be a pointer or interface type and
it must be <a href="#Type_definitions">defined</a> in the same package as the method. it must be declared in the same package as the method.
The method is said to be <i>bound</i> to the base type and the method name The method is said to be <i>bound</i> to the base type and the method name
is visible only within <a href="#Selectors">selectors</a> for type <code>T</code> is visible only within <a href="#Selectors">selectors</a> for type <code>T</code>
or <code>*T</code>. or <code>*T</code>.
@@ -2295,8 +2235,7 @@ The key is interpreted as a field name for struct literals,
an index for array and slice literals, and a key for map literals. an index for array and slice literals, and a key for map literals.
For map literals, all elements must have a key. It is an error For map literals, all elements must have a key. It is an error
to specify multiple elements with the same field name or to specify multiple elements with the same field name or
constant key value. For non-constant map keys, see the section on constant key value.
<a href="#Order_of_evaluation">evaluation order</a>.
</p> </p>
<p> <p>
@@ -2553,13 +2492,13 @@ If <code>x</code> is a package name, see the section on
A selector <code>f</code> may denote a field or method <code>f</code> of A selector <code>f</code> may denote a field or method <code>f</code> of
a type <code>T</code>, or it may refer a type <code>T</code>, or it may refer
to a field or method <code>f</code> of a nested to a field or method <code>f</code> of a nested
<a href="#Struct_types">embedded field</a> of <code>T</code>. <a href="#Struct_types">anonymous field</a> of <code>T</code>.
The number of embedded fields traversed The number of anonymous fields traversed
to reach <code>f</code> is called its <i>depth</i> in <code>T</code>. to reach <code>f</code> is called its <i>depth</i> in <code>T</code>.
The depth of a field or method <code>f</code> The depth of a field or method <code>f</code>
declared in <code>T</code> is zero. declared in <code>T</code> is zero.
The depth of a field or method <code>f</code> declared in The depth of a field or method <code>f</code> declared in
an embedded field <code>A</code> in <code>T</code> is the an anonymous field <code>A</code> in <code>T</code> is the
depth of <code>f</code> in <code>A</code> plus one. depth of <code>f</code> in <code>A</code> plus one.
</p> </p>
@@ -3384,7 +3323,7 @@ to the type of the other operand.
<p> <p>
The right operand in a shift expression must have unsigned integer type The right operand in a shift expression must have unsigned integer type
or be an untyped constant representable by a value of type <code>uint</code>. or be an untyped constant that can be converted to unsigned integer type.
If the left operand of a non-constant shift expression is an untyped constant, If the left operand of a non-constant shift expression is an untyped constant,
it is first converted to the type it would assume if the shift expression were it is first converted to the type it would assume if the shift expression were
replaced by its left operand alone. replaced by its left operand alone.
@@ -3582,33 +3521,6 @@ IEEE-754 standard; whether a <a href="#Run_time_panics">run-time panic</a>
occurs is implementation-specific. occurs is implementation-specific.
</p> </p>
<p>
An implementation may combine multiple floating-point operations into a single
fused operation, possibly across statements, and produce a result that differs
from the value obtained by executing and rounding the instructions individually.
A floating-point type <a href="#Conversions">conversion</a> explicitly rounds to
the precision of the target type, preventing fusion that would discard that rounding.
</p>
<p>
For instance, some architectures provide a "fused multiply and add" (FMA) instruction
that computes <code>x*y + z</code> without rounding the intermediate result <code>x*y</code>.
These examples show when a Go implementation can use that instruction:
</p>
<pre>
// FMA allowed for computing r, because x*y is not explicitly rounded:
r = x*y + z
r = z; r += x*y
t = x*y; r = t + z
*p = x*y; r = *p + z
r = x*y + float64(z)
// FMA disallowed for computing r, because it would omit rounding of x*y:
r = float64(x*y) + z
r = z; r += float64(x*y)
t = float64(x*y); r = t + z
</pre>
<h4 id="String_concatenation">String concatenation</h4> <h4 id="String_concatenation">String concatenation</h4>
@@ -3667,7 +3579,7 @@ These terms and the result of the comparisons are defined as follows:
</li> </li>
<li> <li>
Floating-point values are comparable and ordered, Floating point values are comparable and ordered,
as defined by the IEEE-754 standard. as defined by the IEEE-754 standard.
</li> </li>
@@ -3937,8 +3849,7 @@ in any of these cases:
</li> </li>
<li> <li>
ignoring struct tags (see below), ignoring struct tags (see below),
<code>x</code>'s type and <code>T</code> are pointer types <code>x</code>'s type and <code>T</code> are unnamed pointer types
that are not <a href="#Type_definitions">defined types</a>,
and their pointer base types have identical underlying types. and their pointer base types have identical underlying types.
</li> </li>
<li> <li>
@@ -4523,8 +4434,8 @@ a[i] = 23
<p> <p>
An <i>assignment operation</i> <code>x</code> <i>op</i><code>=</code> An <i>assignment operation</i> <code>x</code> <i>op</i><code>=</code>
<code>y</code> where <i>op</i> is a binary <a href="#Arithmetic_operators">arithmetic operator</a> <code>y</code> where <i>op</i> is a binary arithmetic operation is equivalent
is equivalent to <code>x</code> <code>=</code> <code>x</code> <i>op</i> to <code>x</code> <code>=</code> <code>x</code> <i>op</i>
<code>(y)</code> but evaluates <code>x</code> <code>(y)</code> but evaluates <code>x</code>
only once. The <i>op</i><code>=</code> construct is a single token. only once. The <i>op</i><code>=</code> construct is a single token.
In assignment operations, both the left- and right-hand expression lists In assignment operations, both the left- and right-hand expression lists
@@ -5025,8 +4936,8 @@ a single byte in the string.
<li> <li>
The iteration order over maps is not specified The iteration order over maps is not specified
and is not guaranteed to be the same from one iteration to the next. and is not guaranteed to be the same from one iteration to the next.
If a map entry that has not yet been reached is removed during iteration, If map entries that have not yet been reached are removed during iteration,
the corresponding iteration value will not be produced. If a map entry is the corresponding iteration values will not be produced. If map entries are
created during iteration, that entry may be produced during the iteration or created during iteration, that entry may be produced during the iteration or
may be skipped. The choice may vary for each entry created and from one may be skipped. The choice may vary for each entry created and from one
iteration to the next. iteration to the next.
@@ -5126,7 +5037,7 @@ function completes.
<pre> <pre>
go Server() go Server()
go func(ch chan&lt;- bool) { for { sleep(10); ch &lt;- true }} (c) go func(ch chan&lt;- bool) { for { sleep(10); ch &lt;- true; }} (c)
</pre> </pre>
@@ -5672,7 +5583,7 @@ make(T, n) slice slice of type T with length n and capacity n
make(T, n, m) slice slice of type T with length n and capacity m make(T, n, m) slice slice of type T with length n and capacity m
make(T) map map of type T make(T) map map of type T
make(T, n) map map of type T with initial space for approximately n elements make(T, n) map map of type T with initial space for n elements
make(T) channel unbuffered channel of type T make(T) channel unbuffered channel of type T
make(T, n) channel buffered channel of type T, buffer size n make(T, n) channel buffered channel of type T, buffer size n
@@ -5695,15 +5606,9 @@ s := make([]int, 1e3) // slice with len(s) == cap(s) == 1000
s := make([]int, 1&lt;&lt;63) // illegal: len(s) is not representable by a value of type int s := make([]int, 1&lt;&lt;63) // illegal: len(s) is not representable by a value of type int
s := make([]int, 10, 0) // illegal: len(s) > cap(s) s := make([]int, 10, 0) // illegal: len(s) > cap(s)
c := make(chan int, 10) // channel with a buffer size of 10 c := make(chan int, 10) // channel with a buffer size of 10
m := make(map[string]int, 100) // map with initial space for approximately 100 elements m := make(map[string]int, 100) // map with initial space for 100 elements
</pre> </pre>
<p>
Calling <code>make</code> with a map type and size hint <code>n</code> will
create a map with initial space to hold <code>n</code> map elements.
The precise behavior is implementation-dependent.
</p>
<h3 id="Appending_and_copying_slices">Appending to and copying slices</h3> <h3 id="Appending_and_copying_slices">Appending to and copying slices</h3>
@@ -5965,11 +5870,6 @@ print prints all arguments; formatting of arguments is implementation-speci
println like print but prints spaces between arguments and a newline at the end println like print but prints spaces between arguments and a newline at the end
</pre> </pre>
<p>
Implementation restriction: <code>print</code> and <code>println</code> need not
accept arbitrary argument types, but printing of boolean, numeric, and string
<a href="#Types">types</a> must be supported.
</p>
<h2 id="Packages">Packages</h2> <h2 id="Packages">Packages</h2>
@@ -6431,7 +6331,7 @@ func Sizeof(variable ArbitraryType) uintptr
A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code> A <code>Pointer</code> is a <a href="#Pointer_types">pointer type</a> but a <code>Pointer</code>
value may not be <a href="#Address_operators">dereferenced</a>. value may not be <a href="#Address_operators">dereferenced</a>.
Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to Any pointer or value of <a href="#Types">underlying type</a> <code>uintptr</code> can be converted to
a type of underlying type <code>Pointer</code> and vice versa. a <code>Pointer</code> type and vice versa.
The effect of converting between <code>Pointer</code> and <code>uintptr</code> is implementation-defined. The effect of converting between <code>Pointer</code> and <code>uintptr</code> is implementation-defined.
</p> </p>
@@ -6509,7 +6409,7 @@ The following minimal alignment properties are guaranteed:
</li> </li>
<li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as <li>For a variable <code>x</code> of array type: <code>unsafe.Alignof(x)</code> is the same as
the alignment of a variable of the array's element type. <code>unsafe.Alignof(x[0])</code>, but at least 1.
</li> </li>
</ol> </ol>

View File

@@ -59,12 +59,6 @@ The <a href="https://reddit.com/r/golang">golang sub-Reddit</a> is a place
for Go news and discussion. for Go news and discussion.
</p> </p>
<h3 id="gotime"><a href="https://changelog.com/gotime">Go Time Podcast</a></h3>
<p>
The <a href="https://changelog.com/gotime">Go Time podcast</a> is a panel of Go experts and special guests
discussing the Go programming language, the community, and everything in between.
</p>
<h2 id="community">Community resources</h2> <h2 id="community">Community resources</h2>
<h3 id="go_user_groups"><a href="/wiki/GoUserGroups">Go User Groups</a></h3> <h3 id="go_user_groups"><a href="/wiki/GoUserGroups">Go User Groups</a></h3>

View File

@@ -143,13 +143,10 @@ packaged Go distribution.
<p> <p>
To build a bootstrap tool chain from source, use To build a bootstrap tool chain from source, use
either the git branch <code>release-branch.go1.4</code> or either the git branch <code>release-branch.go1.4</code> or
<a href="https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz">go1.4-bootstrap-20170531.tar.gz</a>, <a href="https://storage.googleapis.com/golang/go1.4-bootstrap-20161024.tar.gz">go1.4-bootstrap-20161024.tar.gz</a>,
which contains the Go 1.4 source code plus accumulated fixes which contains the Go 1.4 source code plus accumulated fixes
to keep the tools running on newer operating systems. to keep the tools running on newer operating systems.
(Go 1.4 was the last distribution in which the tool chain was written in C.) (Go 1.4 was the last distribution in which the tool chain was written in C.)
After unpacking the Go 1.4 source, <code>cd</code> to
the <code>src</code> subdirectory and run <code>make.bash</code> (or,
on Windows, <code>make.bat</code>).
</p> </p>
<p> <p>
@@ -221,7 +218,7 @@ To build without <code>cgo</code>, set the environment variable
Change to the directory that will be its parent Change to the directory that will be its parent
and make sure the <code>go</code> directory does not exist. and make sure the <code>go</code> directory does not exist.
Then clone the repository and check out the latest release tag Then clone the repository and check out the latest release tag
(<code class="versionTag">go1.8.1</code>, for example):</p> (<code class="versionTag">go1.7.4</code>, for example):</p>
<pre> <pre>
$ git clone https://go.googlesource.com/go $ git clone https://go.googlesource.com/go
@@ -409,7 +406,7 @@ New releases are announced on the
<a href="//groups.google.com/group/golang-announce">golang-announce</a> <a href="//groups.google.com/group/golang-announce">golang-announce</a>
mailing list. mailing list.
Each announcement mentions the latest release tag, for instance, Each announcement mentions the latest release tag, for instance,
<code class="versionTag">go1.8.1</code>. <code class="versionTag">go1.7.4</code>.
</p> </p>
<p> <p>

View File

@@ -33,7 +33,7 @@ system and architecture, try
<h2 id="requirements">System requirements</h2> <h2 id="requirements">System requirements</h2>
<p> <p>
Go <a href="https://golang.org/dl/">binary distributions</a> are available for these supported operating systems and architectures. Go binary distributions are available for these supported operating systems and architectures.
Please ensure your system meets these requirements before proceeding. Please ensure your system meets these requirements before proceeding.
If your OS or architecture is not on the list, you may be able to If your OS or architecture is not on the list, you may be able to
<a href="/doc/install/source">install from source</a> or <a href="/doc/install/source">install from source</a> or
@@ -47,10 +47,10 @@ If your OS or architecture is not on the list, you may be able to
<th align="center">Notes</th> <th align="center">Notes</th>
</tr> </tr>
<tr><td colspan="3"><hr></td></tr> <tr><td colspan="3"><hr></td></tr>
<tr><td>FreeBSD 9.3 or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</td></tr> <tr><td>FreeBSD 8-STABLE or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
<tr valign='top'><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm, arm64,<br>s390x, ppc64le</td> <td>CentOS/RHEL 5.x not supported.<br>Install from source for other libc.</td></tr> <tr><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm, s390x, ppc64le</td> <td>CentOS/RHEL 5.x not supported</td></tr>
<tr><td>macOS 10.8 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>&#8224;</sup> that comes with Xcode<sup>&#8225;</sup> for <code>cgo</code> support</td></tr> <tr><td>Mac OS X 10.8 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>&#8224;</sup> that comes with Xcode<sup>&#8225;</sup> for <code>cgo</code> support</td></tr>
<tr><td>Windows XP SP2 or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>&#8224;</sup>. No need for cygwin or msys.</td></tr> <tr><td>Windows XP or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>&#8224;</sup>. No need for cygwin or msys.</td></tr>
</table> </table>
<p> <p>
@@ -222,7 +222,8 @@ and building a simple program, as follows.
Create your <a href="code.html#Workspaces">workspace</a> directory, Create your <a href="code.html#Workspaces">workspace</a> directory,
<code class="testUnix">$HOME/go</code><code class="testWindows">%USERPROFILE%\go</code>. <code class="testUnix">$HOME/go</code><code class="testWindows">%USERPROFILE%\go</code>.
(If you'd like to use a different directory, (If you'd like to use a different directory,
you will need to <a href="https://golang.org/wiki/SettingGOPATH">set the <code>GOPATH</code> environment variable</a>.) you will need to set the <code>GOPATH</code> environment variable;
see <a href="code.html#Workspaces">How to Write Go Code</a> for details.)
</p> </p>
<p> <p>
@@ -249,7 +250,7 @@ $ <b>cd $HOME/go/src/hello</b>
$ <b>go build</b> $ <b>go build</b>
</pre> </pre>
<pre class="testWindows"> <pre class="testWindows" style="display: none">
C:\&gt; <b>cd %USERPROFILE%\go\src\hello</b> C:\&gt; <b>cd %USERPROFILE%\go\src\hello</b>
C:\Users\Gopher\go\src\hello&gt; <b>go build</b> C:\Users\Gopher\go\src\hello&gt; <b>go build</b>
</pre> </pre>
@@ -266,7 +267,7 @@ $ <b>./hello</b>
hello, world hello, world
</pre> </pre>
<pre class="testWindows"> <pre class="testWindows" style="display: none">
C:\Users\Gopher\go\src\hello&gt; <b>hello</b> C:\Users\Gopher\go\src\hello&gt; <b>hello</b>
hello, world hello, world
</pre> </pre>

View File

@@ -20,7 +20,7 @@ This mail is delivered to a small security team.
Your email will be acknowledged within 24 hours, and you'll receive a more Your email will be acknowledged within 24 hours, and you'll receive a more
detailed response to your email within 72 hours indicating the next steps in detailed response to your email within 72 hours indicating the next steps in
handling your report. handling your report.
For critical problems, you can encrypt your report using our PGP key (listed below). If you would like, you can encrypt your report using our PGP key (listed below).
</p> </p>
<p> <p>
@@ -118,12 +118,6 @@ If you have any suggestions to improve this policy, please send an email to
<h3>PGP Key for <a href="mailto:security@golang.org">security@golang.org</a></h3> <h3>PGP Key for <a href="mailto:security@golang.org">security@golang.org</a></h3>
<p>
We accept PGP-encrypted email, but the majority of the security team
are not regular PGP users so it's somewhat inconvenient. Please only
use PGP for critical security reports.
</p>
<pre> <pre>
-----BEGIN PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org Comment: GPGTools - https://gpgtools.org

View File

@@ -8,8 +8,8 @@
# Consult http://www.iana.org/time-zones for the latest versions. # Consult http://www.iana.org/time-zones for the latest versions.
# Versions to use. # Versions to use.
CODE=2017b CODE=2016j
DATA=2017b DATA=2016j
set -e set -e
rm -rf work rm -rf work
@@ -42,7 +42,7 @@ zip -0 -r ../../zoneinfo.zip *
cd ../.. cd ../..
echo echo
if [ "$1" = "-work" ]; then if [ "$1" == "-work" ]; then
echo Left workspace behind in work/. echo Left workspace behind in work/.
else else
rm -rf work rm -rf work

Binary file not shown.

View File

@@ -24,16 +24,7 @@ func run(args ...string) string {
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
cmd := exec.Command("adb", args...) cmd := exec.Command("adb", args...)
cmd.Stdout = io.MultiWriter(os.Stdout, buf) cmd.Stdout = io.MultiWriter(os.Stdout, buf)
// If the adb subprocess somehow hangs, go test will kill this wrapper cmd.Stderr = os.Stderr
// and wait for our os.Stderr (and os.Stdout) to close as a result.
// However, if the os.Stderr (or os.Stdout) file descriptors are
// passed on, the hanging adb subprocess will hold them open and
// go test will hang forever.
//
// Avoid that by wrapping stderr, breaking the short circuit and
// forcing cmd.Run to use another pipe and goroutine to pass
// along stderr from adb.
cmd.Stderr = struct{ io.Writer }{os.Stderr}
log.Printf("adb %s", strings.Join(args, " ")) log.Printf("adb %s", strings.Join(args, " "))
err := cmd.Run() err := cmd.Run()
if err != nil { if err != nil {

View File

@@ -1,18 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 18452: show pos info in undefined name errors
package p
import (
"C"
"fmt"
)
func a() {
fmt.Println("Hello, world!")
C.function_that_does_not_exist() // line 16
C.pi // line 17
}

View File

@@ -1,7 +0,0 @@
package main
import "C"
func main() {
_ = C.malloc // ERROR HERE
}

View File

@@ -17,7 +17,7 @@ check() {
expect() { expect() {
file=$1 file=$1
shift shift
if go build -gcflags=-C $file >errs 2>&1; then if go build $file >errs 2>&1; then
echo 1>&2 misc/cgo/errors/test.bash: BUG: expected cgo to fail on $file but it succeeded echo 1>&2 misc/cgo/errors/test.bash: BUG: expected cgo to fail on $file but it succeeded
exit 1 exit 1
fi fi
@@ -47,8 +47,6 @@ expect issue13635.go C.uchar C.schar C.ushort C.uint C.ulong C.longlong C.ulongl
check issue13830.go check issue13830.go
check issue16116.go check issue16116.go
check issue16591.go check issue16591.go
check issue18889.go
expect issue18452.go issue18452.go:16 issue18452.go:17
if ! go build issue14669.go; then if ! go build issue14669.go; then
exit 1 exit 1

View File

@@ -12,7 +12,7 @@ FC=$1
goos=$(go env GOOS) goos=$(go env GOOS)
libext="so" libext="so"
if [ "$goos" = "darwin" ]; then if [ "$goos" == "darwin" ]; then
libext="dylib" libext="dylib"
fi fi

View File

@@ -76,9 +76,5 @@ func TestThreadLock(t *testing.T) { testThreadLockFunc(t) }
func TestCheckConst(t *testing.T) { testCheckConst(t) } func TestCheckConst(t *testing.T) { testCheckConst(t) }
func Test17537(t *testing.T) { test17537(t) } func Test17537(t *testing.T) { test17537(t) }
func Test18126(t *testing.T) { test18126(t) } func Test18126(t *testing.T) { test18126(t) }
func Test20369(t *testing.T) { test20369(t) }
func Test18720(t *testing.T) { test18720(t) }
func Test20266(t *testing.T) { test20266(t) }
func Test20129(t *testing.T) { test20129(t) }
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) } func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }

View File

@@ -73,7 +73,7 @@ func test18146(t *testing.T) {
} }
runtime.GOMAXPROCS(threads) runtime.GOMAXPROCS(threads)
argv := append(os.Args, "-test.run=NoSuchTestExists") argv := append(os.Args, "-test.run=NoSuchTestExists")
if err := syscall.Exec(os.Args[0], argv, os.Environ()); err != nil { if err := syscall.Exec(os.Args[0], argv, nil); err != nil {
t.Fatal(err) t.Fatal(err)
} }
} }

View File

@@ -1,28 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
/*
#define HELLO "hello"
#define WORLD "world"
#define HELLO_WORLD HELLO "\000" WORLD
struct foo { char c; };
#define SIZE_OF(x) sizeof(x)
#define SIZE_OF_FOO SIZE_OF(struct foo)
*/
import "C"
import "testing"
func test18720(t *testing.T) {
if C.HELLO_WORLD != "hello\000world" {
t.Fatalf(`expected "hello\000world", but got %q`, C.HELLO_WORLD)
}
// Issue 20125.
if got, want := C.SIZE_OF_FOO, 1; got != want {
t.Errorf("C.SIZE_OF_FOO == %v, expected %v", got, want)
}
}

View File

@@ -1,33 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
/*
int issue20129 = 0;
typedef void issue20129Void;
issue20129Void issue20129Foo() {
issue20129 = 1;
}
typedef issue20129Void issue20129Void2;
issue20129Void2 issue20129Bar() {
issue20129 = 2;
}
*/
import "C"
import "testing"
func test20129(t *testing.T) {
if C.issue20129 != 0 {
t.Fatal("test is broken")
}
C.issue20129Foo()
if C.issue20129 != 1 {
t.Errorf("got %v but expected %v", C.issue20129, 1)
}
C.issue20129Bar()
if C.issue20129 != 2 {
t.Errorf("got %v but expected %v", C.issue20129, 2)
}
}

View File

@@ -1,21 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 20266: use -I with a relative path.
package cgotest
/*
#cgo CFLAGS: -I issue20266 -Iissue20266 -Ddef20266
#include "issue20266.h"
*/
import "C"
import "testing"
func test20266(t *testing.T) {
if got, want := C.issue20266, 20266; got != want {
t.Errorf("got %d, want %d", got, want)
}
}

View File

@@ -1,9 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#define issue20266 20266
#ifndef def20266
#error "expected def20266 to be defined"
#endif

View File

@@ -1,20 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
/*
#define UINT64_MAX 18446744073709551615ULL
*/
import "C"
import (
"math"
"testing"
)
func test20369(t *testing.T) {
if C.UINT64_MAX != math.MaxUint64 {
t.Fatalf("got %v, want %v", uint64(C.UINT64_MAX), uint64(math.MaxUint64))
}
}

View File

@@ -74,15 +74,18 @@ func testNaming(t *testing.T) {
} }
} }
if c := C.myfloat_def; c != 1.5 { // This would be nice, but it has never worked.
t.Errorf("C.myint_def = %v, want 1.5", c) /*
} if c := C.myfloat_def; c != 1.5 {
{ t.Errorf("C.myint_def = %v, want 1.5", c)
const c = C.myfloat_def
if c != 1.5 {
t.Errorf("C.myint as const = %v, want 1.5", c)
} }
} {
const c = C.myfloat_def
if c != 1.5 {
t.Errorf("C.myint as const = %v, want 1.5", c)
}
}
*/
if s := C.mystring_def; s != "hello" { if s := C.mystring_def; s != "hello" {
t.Errorf("C.mystring_def = %q, want %q", s, "hello") t.Errorf("C.mystring_def = %q, want %q", s, "hello")

View File

@@ -17,7 +17,7 @@ package cgotest
static stack_t oss; static stack_t oss;
static char signalStack[SIGSTKSZ]; static char signalStack[SIGSTKSZ];
static void changeSignalStack(void) { static void changeSignalStack() {
stack_t ss; stack_t ss;
memset(&ss, 0, sizeof ss); memset(&ss, 0, sizeof ss);
ss.ss_sp = signalStack; ss.ss_sp = signalStack;
@@ -29,7 +29,7 @@ static void changeSignalStack(void) {
} }
} }
static void restoreSignalStack(void) { static void restoreSignalStack() {
#if (defined(__x86_64__) || defined(__i386__)) && defined(__APPLE__) #if (defined(__x86_64__) || defined(__i386__)) && defined(__APPLE__)
// The Darwin C library enforces a minimum that the kernel does not. // The Darwin C library enforces a minimum that the kernel does not.
// This is OK since we allocated this much space in mpreinit, // This is OK since we allocated this much space in mpreinit,
@@ -42,7 +42,7 @@ static void restoreSignalStack(void) {
} }
} }
static int zero(void) { static int zero() {
return 0; return 0;
} }
*/ */

View File

@@ -115,10 +115,8 @@ func init() {
func goEnv(key string) string { func goEnv(key string) string {
out, err := exec.Command("go", "env", key).Output() out, err := exec.Command("go", "env", key).Output()
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "go env %s failed:\n%s\n", key, err) fmt.Fprintf(os.Stderr, "go env %s failed:\n%s", key, err)
if ee, ok := err.(*exec.ExitError); ok { fmt.Fprintf(os.Stderr, "%s", err.(*exec.ExitError).Stderr)
fmt.Fprintf(os.Stderr, "%s", ee.Stderr)
}
os.Exit(2) os.Exit(2)
} }
return strings.TrimSpace(string(out)) return strings.TrimSpace(string(out))
@@ -220,7 +218,15 @@ func TestEarlySignalHandler(t *testing.T) {
} }
func TestSignalForwarding(t *testing.T) { func TestSignalForwarding(t *testing.T) {
checkSignalForwardingTest(t) switch GOOS {
case "darwin":
switch GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
}
case "windows":
t.Skip("skipping signal test on Windows")
}
defer func() { defer func() {
os.Remove("libgo2.a") os.Remove("libgo2.a")
@@ -245,19 +251,32 @@ func TestSignalForwarding(t *testing.T) {
cmd = exec.Command(bin[0], append(bin[1:], "1")...) cmd = exec.Command(bin[0], append(bin[1:], "1")...)
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
t.Logf("%s", out)
expectSignal(t, err, syscall.SIGSEGV)
// Test SIGPIPE forwarding if err == nil {
cmd = exec.Command(bin[0], append(bin[1:], "3")...) t.Logf("%s", out)
t.Error("test program succeeded unexpectedly")
out, err = cmd.CombinedOutput() } else if ee, ok := err.(*exec.ExitError); !ok {
t.Logf("%s", out) t.Logf("%s", out)
expectSignal(t, err, syscall.SIGPIPE) t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err)
} else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok {
t.Logf("%s", out)
t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys())
} else if !ws.Signaled() || ws.Signal() != syscall.SIGSEGV {
t.Logf("%s", out)
t.Errorf("got %v; expected SIGSEGV", ee)
}
} }
func TestSignalForwardingExternal(t *testing.T) { func TestSignalForwardingExternal(t *testing.T) {
checkSignalForwardingTest(t) switch GOOS {
case "darwin":
switch GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
}
case "windows":
t.Skip("skipping signal test on Windows")
}
defer func() { defer func() {
os.Remove("libgo2.a") os.Remove("libgo2.a")
@@ -325,7 +344,14 @@ func TestSignalForwardingExternal(t *testing.T) {
continue continue
} }
if expectSignal(t, err, syscall.SIGSEGV) { if ee, ok := err.(*exec.ExitError); !ok {
t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err)
} else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok {
t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys())
} else if !ws.Signaled() || ws.Signal() != syscall.SIGSEGV {
t.Errorf("got %v; expected SIGSEGV", ee)
} else {
// We got the error we expected.
return return
} }
} }
@@ -333,38 +359,6 @@ func TestSignalForwardingExternal(t *testing.T) {
t.Errorf("program succeeded unexpectedly %d times", tries) t.Errorf("program succeeded unexpectedly %d times", tries)
} }
// checkSignalForwardingTest calls t.Skip if the SignalForwarding test
// doesn't work on this platform.
func checkSignalForwardingTest(t *testing.T) {
switch GOOS {
case "darwin":
switch GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s; see https://golang.org/issue/13701", GOOS, GOARCH)
}
case "windows":
t.Skip("skipping signal test on Windows")
}
}
// expectSignal checks that err, the exit status of a test program,
// shows a failure due to a specific signal. Returns whether we found
// the expected signal.
func expectSignal(t *testing.T, err error, sig syscall.Signal) bool {
if err == nil {
t.Error("test program succeeded unexpectedly")
} else if ee, ok := err.(*exec.ExitError); !ok {
t.Errorf("error (%v) has type %T; expected exec.ExitError", err, err)
} else if ws, ok := ee.Sys().(syscall.WaitStatus); !ok {
t.Errorf("error.Sys (%v) has type %T; expected syscall.WaitStatus", ee.Sys(), ee.Sys())
} else if !ws.Signaled() || ws.Signal() != sig {
t.Errorf("got %v; expected signal %v", ee, sig)
} else {
return true
}
return false
}
func TestOsSignal(t *testing.T) { func TestOsSignal(t *testing.T) {
switch GOOS { switch GOOS {
case "windows": case "windows":
@@ -544,79 +538,3 @@ func hasDynTag(t *testing.T, f *elf.File, tag elf.DynTag) bool {
} }
return false return false
} }
func TestSIGPROF(t *testing.T) {
switch GOOS {
case "windows", "plan9":
t.Skipf("skipping SIGPROF test on %s", GOOS)
}
t.Parallel()
defer func() {
os.Remove("testp6" + exeSuffix)
os.Remove("libgo6.a")
os.Remove("libgo6.h")
}()
cmd := exec.Command("go", "build", "-buildmode=c-archive", "-o", "libgo6.a", "libgo6")
cmd.Env = gopathEnv
if out, err := cmd.CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Fatal(err)
}
ccArgs := append(cc, "-o", "testp6"+exeSuffix, "main6.c", "libgo6.a")
if out, err := exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Fatal(err)
}
argv := cmdToRun("./testp6")
cmd = exec.Command(argv[0], argv[1:]...)
if out, err := cmd.CombinedOutput(); err != nil {
t.Logf("%s", out)
t.Fatal(err)
}
}
// TestCompileWithoutShared tests that if we compile code without the
// -shared option, we can put it into an archive. When we use the go
// tool with -buildmode=c-archive, it passes -shared to the compiler,
// so we override that. The go tool doesn't work this way, but Bazel
// will likely do it in the future. And it ought to work. This test
// was added because at one time it did not work on PPC GNU/Linux.
func TestCompileWithoutShared(t *testing.T) {
// For simplicity, reuse the signal forwarding test.
checkSignalForwardingTest(t)
defer func() {
os.Remove("libgo2.a")
os.Remove("libgo2.h")
}()
cmd := exec.Command("go", "build", "-buildmode=c-archive", "-gcflags=-shared=false", "-o", "libgo2.a", "libgo2")
cmd.Env = gopathEnv
t.Log(cmd.Args)
out, err := cmd.CombinedOutput()
t.Logf("%s", out)
if err != nil {
t.Fatal(err)
}
exe := "./testnoshared" + exeSuffix
ccArgs := append(cc, "-o", exe, "main5.c", "libgo2.a")
t.Log(ccArgs)
out, err = exec.Command(ccArgs[0], ccArgs[1:]...).CombinedOutput()
t.Logf("%s", out)
if err != nil {
t.Fatal(err)
}
defer os.Remove(exe)
binArgs := append(cmdToRun(exe), "3")
t.Log(binArgs)
out, err = exec.Command(binArgs[0], binArgs[1:]...).CombinedOutput()
t.Logf("%s", out)
expectSignal(t, err, syscall.SIGPIPE)
}

View File

@@ -17,7 +17,6 @@
#include <unistd.h> #include <unistd.h>
#include <sched.h> #include <sched.h>
#include <time.h> #include <time.h>
#include <errno.h>
#include "libgo2.h" #include "libgo2.h"
@@ -27,7 +26,6 @@ static void die(const char* msg) {
} }
static volatile sig_atomic_t sigioSeen; static volatile sig_atomic_t sigioSeen;
static volatile sig_atomic_t sigpipeSeen;
// Use up some stack space. // Use up some stack space.
static void recur(int i, char *p) { static void recur(int i, char *p) {
@@ -39,10 +37,6 @@ static void recur(int i, char *p) {
} }
} }
static void pipeHandler(int signo, siginfo_t* info, void* ctxt) {
sigpipeSeen = 1;
}
// Signal handler that uses up more stack space than a goroutine will have. // Signal handler that uses up more stack space than a goroutine will have.
static void ioHandler(int signo, siginfo_t* info, void* ctxt) { static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
char a[1024]; char a[1024];
@@ -112,10 +106,6 @@ static void init() {
die("sigaction"); die("sigaction");
} }
sa.sa_sigaction = pipeHandler;
if (sigaction(SIGPIPE, &sa, NULL) < 0) {
die("sigaction");
}
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {
@@ -177,30 +167,7 @@ int main(int argc, char** argv) {
nanosleep(&ts, NULL); nanosleep(&ts, NULL);
i++; i++;
if (i > 5000) { if (i > 5000) {
fprintf(stderr, "looping too long waiting for SIGIO\n"); fprintf(stderr, "looping too long waiting for signal\n");
exit(EXIT_FAILURE);
}
}
if (verbose) {
printf("provoking SIGPIPE\n");
}
GoRaiseSIGPIPE();
if (verbose) {
printf("waiting for sigpipeSeen\n");
}
// Wait until the signal has been delivered.
i = 0;
while (!sigpipeSeen) {
ts.tv_sec = 0;
ts.tv_nsec = 1000000;
nanosleep(&ts, NULL);
i++;
if (i > 5000) {
fprintf(stderr, "looping too long waiting for SIGPIPE\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }

View File

@@ -11,7 +11,6 @@
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <sched.h> #include <sched.h>
#include <unistd.h>
#include "libgo3.h" #include "libgo3.h"
@@ -26,31 +25,6 @@ static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
sigioSeen = 1; sigioSeen = 1;
} }
// Set up the SIGPIPE signal handler in a high priority constructor, so
// that it is installed before the Go code starts.
static void pipeHandler(int signo, siginfo_t* info, void* ctxt) {
const char *s = "unexpected SIGPIPE\n";
write(2, s, strlen(s));
exit(EXIT_FAILURE);
}
static void init(void) __attribute__ ((constructor (200)));
static void init() {
struct sigaction sa;
memset(&sa, 0, sizeof sa);
sa.sa_sigaction = pipeHandler;
if (sigemptyset(&sa.sa_mask) < 0) {
die("sigemptyset");
}
sa.sa_flags = SA_SIGINFO;
if (sigaction(SIGPIPE, &sa, NULL) < 0) {
die("sigaction");
}
}
int main(int argc, char** argv) { int main(int argc, char** argv) {
int verbose; int verbose;
struct sigaction sa; struct sigaction sa;
@@ -60,14 +34,6 @@ int main(int argc, char** argv) {
verbose = argc > 2; verbose = argc > 2;
setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0);
if (verbose) {
printf("raising SIGPIPE\n");
}
// Test that the Go runtime handles SIGPIPE, even if we installed
// a non-default SIGPIPE handler before the runtime initializes.
ProvokeSIGPIPE();
if (verbose) { if (verbose) {
printf("calling sigaction\n"); printf("calling sigaction\n");
} }

View File

@@ -68,24 +68,6 @@ int main(int argc, char** argv) {
break; break;
} }
case 3: {
if (verbose) {
printf("attempting SIGPIPE\n");
}
int fd[2];
if (pipe(fd) != 0) {
printf("pipe(2) failed\n");
return 0;
}
// Close the reading end.
close(fd[0]);
// Expect that write(2) fails (EPIPE)
if (write(fd[1], "some data", 9) != -1) {
printf("write(2) unexpectedly succeeded\n");
return 0;
}
}
default: default:
printf("Unknown test: %d\n", test); printf("Unknown test: %d\n", test);
return 0; return 0;

View File

@@ -1,34 +0,0 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test that using the Go profiler in a C program does not crash.
#include <stddef.h>
#include <sys/time.h>
#include "libgo6.h"
int main(int argc, char **argv) {
struct timeval tvstart, tvnow;
int diff;
gettimeofday(&tvstart, NULL);
go_start_profile();
// Busy wait so we have something to profile.
// If we just sleep the profiling signal will never fire.
while (1) {
gettimeofday(&tvnow, NULL);
diff = (tvnow.tv_sec - tvstart.tv_sec) * 1000 * 1000 + (tvnow.tv_usec - tvstart.tv_usec);
// Profile frequency is 100Hz so we should definitely
// get a signal in 50 milliseconds.
if (diff > 50 * 1000)
break;
}
go_stop_profile();
return 0;
}

View File

@@ -4,30 +4,6 @@
package main package main
/*
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
// Raise SIGPIPE.
static void CRaiseSIGPIPE() {
int fds[2];
if (pipe(fds) == -1) {
perror("pipe");
exit(EXIT_FAILURE);
}
// Close the reader end
close(fds[0]);
// Write to the writer end to provoke a SIGPIPE
if (write(fds[1], "some data", 9) != -1) {
fprintf(stderr, "write to a closed pipe succeeded\n");
exit(EXIT_FAILURE);
}
close(fds[1]);
}
*/
import "C" import "C"
import ( import (
@@ -70,11 +46,5 @@ func TestSEGV() {
func Noop() { func Noop() {
} }
// Raise SIGPIPE.
//export GoRaiseSIGPIPE
func GoRaiseSIGPIPE() {
C.CRaiseSIGPIPE()
}
func main() { func main() {
} }

View File

@@ -40,17 +40,5 @@ func SawSIGIO() C.int {
} }
} }
// ProvokeSIGPIPE provokes a kernel-initiated SIGPIPE.
//export ProvokeSIGPIPE
func ProvokeSIGPIPE() {
r, w, err := os.Pipe()
if err != nil {
panic(err)
}
r.Close()
defer w.Close()
w.Write([]byte("some data"))
}
func main() { func main() {
} }

View File

@@ -1,25 +0,0 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"runtime/pprof"
)
import "C"
//export go_start_profile
func go_start_profile() {
pprof.StartCPUProfile(ioutil.Discard)
}
//export go_stop_profile
func go_stop_profile() {
pprof.StopCPUProfile()
}
func main() {
}

View File

@@ -12,7 +12,6 @@
// int8_t DidInitRun(); // int8_t DidInitRun();
// int8_t DidMainRun(); // int8_t DidMainRun();
// int32_t FromPkg(); // int32_t FromPkg();
// uint32_t Divu(uint32_t, uint32_t);
int main(void) { int main(void) {
int8_t ran_init = DidInitRun(); int8_t ran_init = DidInitRun();
if (!ran_init) { if (!ran_init) {
@@ -31,11 +30,6 @@ int main(void) {
fprintf(stderr, "ERROR: FromPkg=%d, want %d\n", from_pkg, 1024); fprintf(stderr, "ERROR: FromPkg=%d, want %d\n", from_pkg, 1024);
return 1; return 1;
} }
uint32_t divu = Divu(2264, 31);
if (divu != 73) {
fprintf(stderr, "ERROR: Divu(2264, 31)=%d, want %d\n", divu, 73);
return 1;
}
// test.bash looks for "PASS" to ensure this program has reached the end. // test.bash looks for "PASS" to ensure this program has reached the end.
printf("PASS\n"); printf("PASS\n");
return 0; return 0;

View File

@@ -8,5 +8,3 @@ import "C"
//export FromPkg //export FromPkg
func FromPkg() int32 { return 1024 } func FromPkg() int32 { return 1024 }
//export Divu
func Divu(a, b uint32) uint32 { return a / b }

View File

@@ -27,7 +27,7 @@ fi
# Directory where cgo headers and outputs will be installed. # Directory where cgo headers and outputs will be installed.
# The installation directory format varies depending on the platform. # The installation directory format varies depending on the platform.
installdir=pkg/${goos}_${goarch}_testcshared_shared installdir=pkg/${goos}_${goarch}_testcshared_shared
if [ "${goos}" = "darwin" ]; then if [ "${goos}" == "darwin" ]; then
installdir=pkg/${goos}_${goarch}_testcshared installdir=pkg/${goos}_${goarch}_testcshared
fi fi
@@ -40,13 +40,13 @@ function cleanup() {
rm -f testp testp2 testp3 testp4 testp5 rm -f testp testp2 testp3 testp4 testp5
rm -rf pkg "${goroot}/${installdir}" rm -rf pkg "${goroot}/${installdir}"
if [ "$goos" = "android" ]; then if [ "$goos" == "android" ]; then
adb shell rm -rf "$androidpath" adb shell rm -rf "$androidpath"
fi fi
} }
trap cleanup EXIT trap cleanup EXIT
if [ "$goos" = "android" ]; then if [ "$goos" == "android" ]; then
adb shell mkdir -p "$androidpath" adb shell mkdir -p "$androidpath"
fi fi
@@ -69,7 +69,7 @@ function run() {
function binpush() { function binpush() {
bin=${1} bin=${1}
if [ "$goos" = "android" ]; then if [ "$goos" == "android" ]; then
adb push "$bin" "${androidpath}/${bin}" 2>/dev/null adb push "$bin" "${androidpath}/${bin}" 2>/dev/null
fi fi
} }
@@ -79,7 +79,7 @@ rm -rf pkg
suffix="-installsuffix testcshared" suffix="-installsuffix testcshared"
libext="so" libext="so"
if [ "$goos" = "darwin" ]; then if [ "$goos" == "darwin" ]; then
libext="dylib" libext="dylib"
fi fi
@@ -89,7 +89,7 @@ GOPATH=$(pwd) go install -buildmode=c-shared $suffix libgo
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go
binpush libgo.$libext binpush libgo.$libext
if [ "$goos" = "linux" ] || [ "$goos" = "android" ] ; then if [ "$goos" == "linux" ] || [ "$goos" == "android" ] ; then
if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then
echo "libgo.$libext has TEXTREL set" echo "libgo.$libext has TEXTREL set"
exit 1 exit 1
@@ -97,8 +97,8 @@ if [ "$goos" = "linux" ] || [ "$goos" = "android" ] ; then
fi fi
GOGCCFLAGS=$(go env GOGCCFLAGS) GOGCCFLAGS=$(go env GOGCCFLAGS)
if [ "$goos" = "android" ]; then if [ "$goos" == "android" ]; then
GOGCCFLAGS="${GOGCCFLAGS} -pie -fuse-ld=gold" GOGCCFLAGS="${GOGCCFLAGS} -pie"
fi fi
status=0 status=0
@@ -127,7 +127,7 @@ fi
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo2.$libext libgo2 GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo2.$libext libgo2
binpush libgo2.$libext binpush libgo2.$libext
linkflags="-Wl,--no-as-needed" linkflags="-Wl,--no-as-needed"
if [ "$goos" = "darwin" ]; then if [ "$goos" == "darwin" ]; then
linkflags="" linkflags=""
fi fi
$(go env CC) ${GOGCCFLAGS} -o testp2 main2.c $linkflags libgo2.$libext $(go env CC) ${GOGCCFLAGS} -o testp2 main2.c $linkflags libgo2.$libext
@@ -139,7 +139,7 @@ if [ "$output" != "PASS" ]; then
fi fi
# test3: tests main.main is exported on android. # test3: tests main.main is exported on android.
if [ "$goos" = "android" ]; then if [ "$goos" == "android" ]; then
$(go env CC) ${GOGCCFLAGS} -o testp3 main3.c -ldl $(go env CC) ${GOGCCFLAGS} -o testp3 main3.c -ldl
binpush testp3 binpush testp3
output=$(run ./testp ./libgo.so) output=$(run ./testp ./libgo.so)
@@ -179,13 +179,6 @@ if test "$output" != "PASS"; then
status=1 status=1
fi fi
if test "$libext" = "dylib"; then
# make sure dylibs are well-formed
if ! otool -l libgo*.dylib >/dev/null; then
status=1
fi
fi
if test $status = 0; then if test $status = 0; then
echo "ok" echo "ok"
fi fi

View File

@@ -1,46 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"iface_i"
"log"
"plugin"
)
func main() {
a, err := plugin.Open("iface_a.so")
if err != nil {
log.Fatalf(`plugin.Open("iface_a.so"): %v`, err)
}
b, err := plugin.Open("iface_b.so")
if err != nil {
log.Fatalf(`plugin.Open("iface_b.so"): %v`, err)
}
af, err := a.Lookup("F")
if err != nil {
log.Fatalf(`a.Lookup("F") failed: %v`, err)
}
bf, err := b.Lookup("F")
if err != nil {
log.Fatalf(`b.Lookup("F") failed: %v`, err)
}
if af.(func() interface{})() != bf.(func() interface{})() {
panic("empty interfaces not equal")
}
ag, err := a.Lookup("G")
if err != nil {
log.Fatalf(`a.Lookup("G") failed: %v`, err)
}
bg, err := b.Lookup("G")
if err != nil {
log.Fatalf(`b.Lookup("G") failed: %v`, err)
}
if ag.(func() iface_i.I)() != bg.(func() iface_i.I)() {
panic("nonempty interfaces not equal")
}
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "iface_i"
//go:noinline
func F() interface{} {
return (*iface_i.T)(nil)
}
//go:noinline
func G() iface_i.I {
return (*iface_i.T)(nil)
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "iface_i"
//go:noinline
func F() interface{} {
return (*iface_i.T)(nil)
}
//go:noinline
func G() iface_i.I {
return (*iface_i.T)(nil)
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package iface_i
type I interface {
M()
}
type T struct {
}
func (t *T) M() {
}
// *T implements I

View File

@@ -1,13 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package dynamodbstreamsevt
import "encoding/json"
var foo json.RawMessage
type Event struct{}
func (e *Event) Dummy() {}

View File

@@ -1,31 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// The bug happened like this:
// 1) The main binary adds an itab for *json.UnsupportedValueError / error
// (concrete type / interface type). This itab goes in hash bucket 0x111.
// 2) The plugin adds that same itab again. That makes a cycle in the itab
// chain rooted at hash bucket 0x111.
// 3) The main binary then asks for the itab for *dynamodbstreamsevt.Event /
// json.Unmarshaler. This itab happens to also live in bucket 0x111.
// The lookup code goes into an infinite loop searching for this itab.
// The code is carefully crafted so that the two itabs are both from the
// same bucket, and so that the second itab doesn't exist in
// the itab hashmap yet (so the entire linked list must be searched).
package main
import (
"encoding/json"
"issue18676/dynamodbstreamsevt"
"plugin"
)
func main() {
plugin.Open("plugin.so")
var x interface{} = (*dynamodbstreamsevt.Event)(nil)
if _, ok := x.(json.Unmarshaler); !ok {
println("something")
}
}

View File

@@ -1,11 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "C"
import "issue18676/dynamodbstreamsevt"
func F(evt *dynamodbstreamsevt.Event) {}

View File

@@ -1,23 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "plugin"
func main() {
p, err := plugin.Open("plugin.so")
if err != nil {
panic(err)
}
sym, err := p.Lookup("Foo")
if err != nil {
panic(err)
}
f := sym.(func() int)
if f() != 42 {
panic("expected f() == 42")
}
}

View File

@@ -1,9 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func Foo() int {
return 42
}

View File

@@ -15,8 +15,8 @@ goos=$(go env GOOS)
goarch=$(go env GOARCH) goarch=$(go env GOARCH)
function cleanup() { function cleanup() {
rm -f plugin*.so unnamed*.so iface*.so rm -f plugin*.so unnamed*.so
rm -rf host pkg sub iface issue18676 issue19534 rm -rf host pkg sub
} }
trap cleanup EXIT trap cleanup EXIT
@@ -32,21 +32,3 @@ GOPATH=$(pwd) go build -buildmode=plugin unnamed2.go
GOPATH=$(pwd) go build host GOPATH=$(pwd) go build host
LD_LIBRARY_PATH=$(pwd) ./host LD_LIBRARY_PATH=$(pwd) ./host
# Test that types and itabs get properly uniqified.
GOPATH=$(pwd) go build -buildmode=plugin iface_a
GOPATH=$(pwd) go build -buildmode=plugin iface_b
GOPATH=$(pwd) go build iface
LD_LIBRARY_PATH=$(pwd) ./iface
# Test for issue 18676 - make sure we don't add the same itab twice.
# The buggy code hangs forever, so use a timeout to check for that.
GOPATH=$(pwd) go build -buildmode=plugin -o plugin.so src/issue18676/plugin.go
GOPATH=$(pwd) go build -o issue18676 src/issue18676/main.go
timeout 10s ./issue18676
# Test for issue 19534 - that we can load a plugin built in a path with non-alpha
# characters
GOPATH=$(pwd) go build -buildmode=plugin -ldflags='-pluginpath=issue.19534' -o plugin.so src/issue19534/plugin.go
GOPATH=$(pwd) go build -o issue19534 src/issue19534/main.go
./issue19534

View File

@@ -9,15 +9,4 @@ import "C"
func FuncInt() int { return 1 } func FuncInt() int { return 1 }
// Add a recursive type to to check that type equality across plugins doesn't
// crash. See https://golang.org/issues/19258
func FuncRecursive() X { return X{} }
type Y struct {
X *X
}
type X struct {
Y Y
}
func main() {} func main() {}

View File

@@ -9,13 +9,4 @@ import "C"
func FuncInt() int { return 2 } func FuncInt() int { return 2 }
func FuncRecursive() X { return X{} }
type Y struct {
X *X
}
type X struct {
Y Y
}
func main() {} func main() {}

View File

@@ -1,12 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This program segfaulted during libpreinit when built with -msan:
// http://golang.org/issue/18707
package main
import "C"
func main() {}

View File

@@ -68,25 +68,6 @@ fi
status=0 status=0
testmsanshared() {
goos=$(go env GOOS)
suffix="-installsuffix testsanitizers"
libext="so"
if [ "$goos" = "darwin" ]; then
libext="dylib"
fi
go build -msan -buildmode=c-shared $suffix -o ${TMPDIR}/libmsanshared.$libext msan_shared.go
echo 'int main() { return 0; }' > ${TMPDIR}/testmsanshared.c
$CC $(go env GOGCCFLAGS) -fsanitize=memory -o ${TMPDIR}/testmsanshared ${TMPDIR}/testmsanshared.c ${TMPDIR}/libmsanshared.$libext
if ! LD_LIBRARY_PATH=. ${TMPDIR}/testmsanshared; then
echo "FAIL: msan_shared"
status=1
fi
rm -f ${TMPDIR}/{testmsanshared,testmsanshared.c,libmsanshared.$libext}
}
if test "$msan" = "yes"; then if test "$msan" = "yes"; then
if ! go build -msan std; then if ! go build -msan std; then
echo "FAIL: build -msan std" echo "FAIL: build -msan std"
@@ -127,29 +108,8 @@ if test "$msan" = "yes"; then
echo "FAIL: msan_fail" echo "FAIL: msan_fail"
status=1 status=1
fi fi
testmsanshared
fi fi
testtsanshared() {
goos=$(go env GOOS)
suffix="-installsuffix tsan"
libext="so"
if [ "$goos" = "darwin" ]; then
libext="dylib"
fi
go build -buildmode=c-shared $suffix -o ${TMPDIR}/libtsanshared.$libext tsan_shared.go
echo 'int main() { return 0; }' > ${TMPDIR}/testtsanshared.c
$CC $(go env GOGCCFLAGS) -fsanitize=thread -o ${TMPDIR}/testtsanshared ${TMPDIR}/testtsanshared.c ${TMPDIR}/libtsanshared.$libext
if ! LD_LIBRARY_PATH=. ${TMPDIR}/testtsanshared; then
echo "FAIL: tsan_shared"
status=1
fi
rm -f ${TMPDIR}/{testtsanshared,testtsanshared.c,libtsanshared.$libext}
}
if test "$tsan" = "yes"; then if test "$tsan" = "yes"; then
echo 'int main() { return 0; }' > ${TMPDIR}/testsanitizers$$.c echo 'int main() { return 0; }' > ${TMPDIR}/testsanitizers$$.c
ok=yes ok=yes
@@ -209,15 +169,14 @@ if test "$tsan" = "yes"; then
fi fi
if test "$ok" = "true"; then if test "$ok" = "true"; then
# These tests require rebuilding os/user with -fsanitize=thread. # This test requires rebuilding os/user with -fsanitize=thread.
testtsan tsan5.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan" testtsan tsan5.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan6.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan7.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan10.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan11.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsan tsan12.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
testtsanshared # This test requires rebuilding runtime/cgo with -fsanitize=thread.
testtsan tsan6.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
# This test requires rebuilding runtime/cgo with -fsanitize=thread.
testtsan tsan7.go "CGO_CFLAGS=-fsanitize=thread CGO_LDFLAGS=-fsanitize=thread" "-installsuffix=tsan"
fi fi
fi fi

View File

@@ -1,31 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program hung when run under the C/C++ ThreadSanitizer.
// TSAN defers asynchronous signals until the signaled thread calls into libc.
// Since the Go runtime makes direct futex syscalls, Go runtime threads could
// run for an arbitrarily long time without triggering the libc interceptors.
// See https://golang.org/issue/18717.
import (
"os"
"os/signal"
"syscall"
)
/*
#cgo CFLAGS: -g -fsanitize=thread
#cgo LDFLAGS: -g -fsanitize=thread
*/
import "C"
func main() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGUSR1)
defer signal.Stop(c)
syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
<-c
}

View File

@@ -1,55 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program hung when run under the C/C++ ThreadSanitizer. TSAN defers
// asynchronous signals until the signaled thread calls into libc. The runtime's
// sysmon goroutine idles itself using direct usleep syscalls, so it could
// run for an arbitrarily long time without triggering the libc interceptors.
// See https://golang.org/issue/18717.
import (
"os"
"os/signal"
"syscall"
)
/*
#cgo CFLAGS: -g -fsanitize=thread
#cgo LDFLAGS: -g -fsanitize=thread
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void raise_usr2(int signo) {
raise(SIGUSR2);
}
static void register_handler(int signo) {
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_ONSTACK;
sa.sa_handler = raise_usr2;
if (sigaction(SIGUSR1, &sa, NULL) != 0) {
perror("failed to register SIGUSR1 handler");
exit(EXIT_FAILURE);
}
}
*/
import "C"
func main() {
ch := make(chan os.Signal)
signal.Notify(ch, syscall.SIGUSR2)
C.register_handler(C.int(syscall.SIGUSR1))
syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
<-ch
}

View File

@@ -1,35 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program hung when run under the C/C++ ThreadSanitizer. TSAN installs a
// libc interceptor that writes signal handlers to a global variable within the
// TSAN runtime instead of making a sigaction system call. A bug in
// syscall.runtime_AfterForkInChild corrupted TSAN's signal forwarding table
// during calls to (*os/exec.Cmd).Run, causing the parent process to fail to
// invoke signal handlers.
import (
"fmt"
"os"
"os/exec"
"os/signal"
"syscall"
)
import "C"
func main() {
ch := make(chan os.Signal)
signal.Notify(ch, syscall.SIGUSR1)
if err := exec.Command("true").Run(); err != nil {
fmt.Fprintf(os.Stderr, "Unexpected error from `true`: %v", err)
os.Exit(1)
}
syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
<-ch
}

View File

@@ -1,63 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
// This program failed with SIGSEGV when run under the C/C++ ThreadSanitizer.
// The Go runtime had re-registered the C handler with the wrong flags due to a
// typo, resulting in null pointers being passed for the info and context
// parameters to the handler.
/*
#cgo CFLAGS: -fsanitize=thread
#cgo LDFLAGS: -fsanitize=thread
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ucontext.h>
void check_params(int signo, siginfo_t *info, void *context) {
ucontext_t* uc = (ucontext_t*)(context);
if (info->si_signo != signo) {
fprintf(stderr, "info->si_signo does not match signo.\n");
abort();
}
if (uc->uc_stack.ss_size == 0) {
fprintf(stderr, "uc_stack has size 0.\n");
abort();
}
}
// Set up the signal handler in a high priority constructor, so
// that it is installed before the Go code starts.
static void register_handler(void) __attribute__ ((constructor (200)));
static void register_handler() {
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = check_params;
if (sigaction(SIGUSR1, &sa, NULL) != 0) {
perror("failed to register SIGUSR1 handler");
exit(EXIT_FAILURE);
}
}
*/
import "C"
import "syscall"
func init() {
C.raise(C.int(syscall.SIGUSR1))
}
func main() {}

View File

@@ -10,6 +10,7 @@ import (
"debug/elf" "debug/elf"
"encoding/binary" "encoding/binary"
"errors" "errors"
"flag"
"fmt" "fmt"
"go/build" "go/build"
"io" "io"
@@ -165,6 +166,7 @@ func TestMain(m *testing.M) {
// That won't work if GOBIN is set. // That won't work if GOBIN is set.
os.Unsetenv("GOBIN") os.Unsetenv("GOBIN")
flag.Parse()
exitCode, err := testMain(m) exitCode, err := testMain(m)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@@ -400,12 +402,6 @@ func TestTrivialExecutablePIE(t *testing.T) {
AssertHasRPath(t, "./trivial.pie", gorootInstallDir) AssertHasRPath(t, "./trivial.pie", gorootInstallDir)
} }
// Build a division test program and check it runs.
func TestDivisionExecutable(t *testing.T) {
goCmd(t, "install", "-linkshared", "division")
run(t, "division executable", "./bin/division")
}
// Build an executable that uses cgo linked against the shared runtime and check it // Build an executable that uses cgo linked against the shared runtime and check it
// runs. // runs.
func TestCgoExecutable(t *testing.T) { func TestCgoExecutable(t *testing.T) {
@@ -763,13 +759,6 @@ func appendFile(path, content string) {
} }
} }
func writeFile(path, content string) {
err := ioutil.WriteFile(path, []byte(content), 0644)
if err != nil {
log.Fatalf("ioutil.WriteFile failed: %v", err)
}
}
func TestABIChecking(t *testing.T) { func TestABIChecking(t *testing.T) {
goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase") goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase")
goCmd(t, "install", "-linkshared", "exe") goCmd(t, "install", "-linkshared", "exe")
@@ -808,10 +797,9 @@ func TestABIChecking(t *testing.T) {
run(t, "rebuilt exe", "./bin/exe") run(t, "rebuilt exe", "./bin/exe")
// If we make a change which does not break ABI (such as adding an unexported // If we make a change which does not break ABI (such as adding an unexported
// function) and rebuild libdepBase.so, exe still works, even if new function // function) and rebuild libdepBase.so, exe still works.
// is in a file by itself.
resetFileStamps() resetFileStamps()
writeFile("src/depBase/dep2.go", "package depBase\nfunc noABIBreak() {}\n") appendFile("src/depBase/dep.go", "func noABIBreak() {}\n")
goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase") goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase")
run(t, "after non-ABI breaking change", "./bin/exe") run(t, "after non-ABI breaking change", "./bin/exe")
} }
@@ -827,14 +815,3 @@ func TestImplicitInclusion(t *testing.T) {
goCmd(t, "install", "-linkshared", "implicitcmd") goCmd(t, "install", "-linkshared", "implicitcmd")
run(t, "running executable linked against library that contains same package as it", "./bin/implicitcmd") run(t, "running executable linked against library that contains same package as it", "./bin/implicitcmd")
} }
// Tests to make sure that the type fields of empty interfaces and itab
// fields of nonempty interfaces are unique even across modules,
// so that interface equality works correctly.
func TestInterface(t *testing.T) {
goCmd(t, "install", "-buildmode=shared", "-linkshared", "iface_a")
// Note: iface_i gets installed implicitly as a dependency of iface_a.
goCmd(t, "install", "-buildmode=shared", "-linkshared", "iface_b")
goCmd(t, "install", "-linkshared", "iface")
run(t, "running type/itab uniqueness tester", "./bin/iface")
}

View File

@@ -5,8 +5,6 @@ import (
"reflect" "reflect"
) )
var SlicePtr interface{} = &[]int{}
var V int = 1 var V int = 1
var HasMask []string = []string{"hi"} var HasMask []string = []string{"hi"}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
//go:noinline
func div(x, y uint32) uint32 {
return x / y
}
func main() {
a := div(97, 11)
if a != 8 {
panic("FAIL")
}
}

View File

@@ -19,8 +19,6 @@ func F() *C {
return nil return nil
} }
var slicePtr interface{} = &[]int{}
func main() { func main() {
defer depBase.ImplementedInAsm() defer depBase.ImplementedInAsm()
// This code below causes various go.itab.* symbols to be generated in // This code below causes various go.itab.* symbols to be generated in
@@ -34,11 +32,4 @@ func main() {
if reflect.TypeOf(F).Out(0) != reflect.TypeOf(c) { if reflect.TypeOf(F).Out(0) != reflect.TypeOf(c) {
panic("bad reflection results, see golang.org/issue/18252") panic("bad reflection results, see golang.org/issue/18252")
} }
sp := reflect.New(reflect.TypeOf(slicePtr).Elem())
s := sp.Interface()
if reflect.TypeOf(s) != reflect.TypeOf(slicePtr) {
panic("bad reflection results, see golang.org/issue/18729")
}
} }

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "iface_a"
import "iface_b"
func main() {
if iface_a.F() != iface_b.F() {
panic("empty interfaces not equal")
}
if iface_a.G() != iface_b.G() {
panic("non-empty interfaces not equal")
}
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package iface_a
import "iface_i"
//go:noinline
func F() interface{} {
return (*iface_i.T)(nil)
}
//go:noinline
func G() iface_i.I {
return (*iface_i.T)(nil)
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package iface_b
import "iface_i"
//go:noinline
func F() interface{} {
return (*iface_i.T)(nil)
}
//go:noinline
func G() iface_i.I {
return (*iface_i.T)(nil)
}

View File

@@ -1,17 +0,0 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package iface_i
type I interface {
M()
}
type T struct {
}
func (t *T) M() {
}
// *T implements I

View File

@@ -23,37 +23,28 @@ import (
func main() { func main() {
devID := detectDevID() devID := detectDevID()
fmt.Printf("export GOIOS_DEV_ID=%s\n", devID)
udid := detectUDID() udid := detectUDID()
mps := detectMobileProvisionFiles(udid) mp := detectMobileProvisionFile(udid)
if len(mps) == 0 {
fail("did not find mobile provision matching device udid %s", udid)
}
fmt.Println("Available provisioning profiles below.") f, err := ioutil.TempFile("", "go_ios_detect_")
fmt.Println("NOTE: Any existing app on the device with the app id specified by GOIOS_APP_ID") check(err)
fmt.Println("will be overwritten when running Go programs.") fname := f.Name()
for _, mp := range mps { defer os.Remove(fname)
fmt.Println()
fmt.Printf("export GOIOS_DEV_ID=%s\n", devID)
f, err := ioutil.TempFile("", "go_ios_detect_")
check(err)
fname := f.Name()
defer os.Remove(fname)
out := output(parseMobileProvision(mp)) out := combinedOutput(parseMobileProvision(mp))
_, err = f.Write(out) _, err = f.Write(out)
check(err) check(err)
check(f.Close()) check(f.Close())
appID, err := plistExtract(fname, "Entitlements:application-identifier") appID, err := plistExtract(fname, "ApplicationIdentifierPrefix:0")
check(err) check(err)
fmt.Printf("export GOIOS_APP_ID=%s\n", appID) fmt.Printf("export GOIOS_APP_ID=%s\n", appID)
teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier") teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier")
check(err) check(err)
fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID) fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID)
}
} }
func detectDevID() string { func detectDevID() string {
@@ -88,11 +79,10 @@ func detectUDID() []byte {
panic("unreachable") panic("unreachable")
} }
func detectMobileProvisionFiles(udid []byte) []string { func detectMobileProvisionFile(udid []byte) string {
cmd := exec.Command("mdfind", "-name", ".mobileprovision") cmd := exec.Command("mdfind", "-name", ".mobileprovision")
lines := getLines(cmd) lines := getLines(cmd)
var files []string
for _, line := range lines { for _, line := range lines {
if len(line) == 0 { if len(line) == 0 {
continue continue
@@ -100,11 +90,12 @@ func detectMobileProvisionFiles(udid []byte) []string {
xmlLines := getLines(parseMobileProvision(string(line))) xmlLines := getLines(parseMobileProvision(string(line)))
for _, xmlLine := range xmlLines { for _, xmlLine := range xmlLines {
if bytes.Contains(xmlLine, udid) { if bytes.Contains(xmlLine, udid) {
files = append(files, string(line)) return string(line)
} }
} }
} }
return files fail("did not find mobile provision matching device udid %s", udid)
panic("ureachable")
} }
func parseMobileProvision(fname string) *exec.Cmd { func parseMobileProvision(fname string) *exec.Cmd {
@@ -120,12 +111,12 @@ func plistExtract(fname string, path string) ([]byte, error) {
} }
func getLines(cmd *exec.Cmd) [][]byte { func getLines(cmd *exec.Cmd) [][]byte {
out := output(cmd) out := combinedOutput(cmd)
return bytes.Split(out, []byte("\n")) return bytes.Split(out, []byte("\n"))
} }
func output(cmd *exec.Cmd) []byte { func combinedOutput(cmd *exec.Cmd) []byte {
out, err := cmd.Output() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
fmt.Println(strings.Join(cmd.Args, "\n")) fmt.Println(strings.Join(cmd.Args, "\n"))
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)

View File

@@ -45,10 +45,9 @@ var errRetry = errors.New("failed to start test harness (retry attempted)")
var tmpdir string var tmpdir string
var ( var (
devID string devID string
appID string appID string
teamID string teamID string
bundleID string
) )
// lock is a file lock to serialize iOS runs. It is global to avoid the // lock is a file lock to serialize iOS runs. It is global to avoid the
@@ -77,13 +76,6 @@ func main() {
// https://developer.apple.com/membercenter/index.action#accountSummary as Team ID. // https://developer.apple.com/membercenter/index.action#accountSummary as Team ID.
teamID = getenv("GOIOS_TEAM_ID") teamID = getenv("GOIOS_TEAM_ID")
parts := strings.SplitN(appID, ".", 2)
// For compatibility with the old builders, use a fallback bundle ID
bundleID = "golang.gotest"
if len(parts) == 2 {
bundleID = parts[1]
}
var err error var err error
tmpdir, err = ioutil.TempDir("", "go_darwin_arm_exec_") tmpdir, err = ioutil.TempDir("", "go_darwin_arm_exec_")
if err != nil { if err != nil {
@@ -147,22 +139,22 @@ func run(bin string, args []string) (err error) {
return err return err
} }
pkgpath, err := copyLocalData(appdir)
if err != nil {
return err
}
entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist") entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist")
if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil { if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
return err return err
} }
if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist(pkgpath)), 0744); err != nil { if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist), 0744); err != nil {
return err return err
} }
if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil { if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
return err return err
} }
pkgpath, err := copyLocalData(appdir)
if err != nil {
return err
}
cmd := exec.Command( cmd := exec.Command(
"codesign", "codesign",
"-f", "-f",
@@ -244,9 +236,20 @@ func run(bin string, args []string) (err error) {
return nil return nil
} }
s.do(`breakpoint set -n getwd`) // in runtime/cgo/gcc_darwin_arm.go
started = true started = true
s.doCmd("run", "stop reason = signal SIGINT", 20*time.Second) s.doCmd("run", "stop reason = breakpoint", 20*time.Second)
// Move the current working directory into the faux gopath.
if pkgpath != "src" {
s.do(`breakpoint delete 1`)
s.do(`expr char* $mem = (char*)malloc(512)`)
s.do(`expr $mem = (char*)getwd($mem, 512)`)
s.do(`expr $mem = (char*)strcat($mem, "/` + pkgpath + `")`)
s.do(`call (void)chdir($mem)`)
}
startTestsLen := s.out.Len() startTestsLen := s.out.Len()
fmt.Fprintln(s.in, `process continue`) fmt.Fprintln(s.in, `process continue`)
@@ -256,9 +259,7 @@ func run(bin string, args []string) (err error) {
return s.out.LastIndex([]byte("\nPASS\n")) > startTestsLen || return s.out.LastIndex([]byte("\nPASS\n")) > startTestsLen ||
s.out.LastIndex([]byte("\nPASS\r")) > startTestsLen || s.out.LastIndex([]byte("\nPASS\r")) > startTestsLen ||
s.out.LastIndex([]byte("\n(lldb) PASS\n")) > startTestsLen || s.out.LastIndex([]byte("\n(lldb) PASS\n")) > startTestsLen ||
s.out.LastIndex([]byte("\n(lldb) PASS\r")) > startTestsLen || s.out.LastIndex([]byte("\n(lldb) PASS\r")) > startTestsLen
s.out.LastIndex([]byte("exited with status = 0 (0x00000000) \n")) > startTestsLen ||
s.out.LastIndex([]byte("exited with status = 0 (0x00000000) \r")) > startTestsLen
} }
err = s.wait("test completion", passed, opts.timeout) err = s.wait("test completion", passed, opts.timeout)
if passed(s.out) { if passed(s.out) {
@@ -346,7 +347,7 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
i2 := s.out.LastIndex([]byte(" connect")) i2 := s.out.LastIndex([]byte(" connect"))
return i0 > 0 && i1 > 0 && i2 > 0 return i0 > 0 && i1 > 0 && i2 > 0
} }
if err := s.wait("lldb start", cond, 15*time.Second); err != nil { if err := s.wait("lldb start", cond, 10*time.Second); err != nil {
panic(waitPanic{err}) panic(waitPanic{err})
} }
return s, nil return s, nil
@@ -444,7 +445,7 @@ func parseArgs(binArgs []string) (opts options, remainingArgs []string) {
remainingArgs = append(remainingArgs, arg) remainingArgs = append(remainingArgs, arg)
} }
f := flag.NewFlagSet("", flag.ContinueOnError) f := flag.NewFlagSet("", flag.ContinueOnError)
f.DurationVar(&opts.timeout, "test.timeout", 10*time.Minute, "") f.DurationVar(&opts.timeout, "test.timeout", 0, "")
f.BoolVar(&opts.lldb, "lldb", false, "") f.BoolVar(&opts.lldb, "lldb", false, "")
f.Parse(flagArgs) f.Parse(flagArgs)
return opts, remainingArgs return opts, remainingArgs
@@ -517,13 +518,13 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
} }
} }
// Copy timezone file.
//
// Typical apps have the zoneinfo.zip in the root of their app bundle,
// read by the time package as the working directory at initialization.
// As we move the working directory to the GOROOT pkg directory, we
// install the zoneinfo.zip file in the pkgpath.
if underGoRoot { if underGoRoot {
// Copy timezone file.
//
// Typical apps have the zoneinfo.zip in the root of their app bundle,
// read by the time package as the working directory at initialization.
// As we move the working directory to the GOROOT pkg directory, we
// install the zoneinfo.zip file in the pkgpath.
err := cp( err := cp(
filepath.Join(dstbase, pkgpath), filepath.Join(dstbase, pkgpath),
filepath.Join(cwd, "lib", "time", "zoneinfo.zip"), filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
@@ -531,19 +532,6 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
if err != nil { if err != nil {
return "", err return "", err
} }
// Copy src/runtime/textflag.h for (at least) Test386EndToEnd in
// cmd/asm/internal/asm.
runtimePath := filepath.Join(dstbase, "src", "runtime")
if err := os.MkdirAll(runtimePath, 0755); err != nil {
return "", err
}
err = cp(
filepath.Join(runtimePath, "textflag.h"),
filepath.Join(cwd, "src", "runtime", "textflag.h"),
)
if err != nil {
return "", err
}
} }
return finalPkgpath, nil return finalPkgpath, nil
@@ -581,8 +569,7 @@ func subdir() (pkgpath string, underGoRoot bool, err error) {
) )
} }
func infoPlist(pkgpath string) string { const infoPlist = `<?xml version="1.0" encoding="UTF-8"?>
return `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
@@ -590,15 +577,13 @@ func infoPlist(pkgpath string) string {
<key>CFBundleSupportedPlatforms</key><array><string>iPhoneOS</string></array> <key>CFBundleSupportedPlatforms</key><array><string>iPhoneOS</string></array>
<key>CFBundleExecutable</key><string>gotest</string> <key>CFBundleExecutable</key><string>gotest</string>
<key>CFBundleVersion</key><string>1.0</string> <key>CFBundleVersion</key><string>1.0</string>
<key>CFBundleIdentifier</key><string>` + bundleID + `</string> <key>CFBundleIdentifier</key><string>golang.gotest</string>
<key>CFBundleResourceSpecification</key><string>ResourceRules.plist</string> <key>CFBundleResourceSpecification</key><string>ResourceRules.plist</string>
<key>LSRequiresIPhoneOS</key><true/> <key>LSRequiresIPhoneOS</key><true/>
<key>CFBundleDisplayName</key><string>gotest</string> <key>CFBundleDisplayName</key><string>gotest</string>
<key>GoExecWrapperWorkingDirectory</key><string>` + pkgpath + `</string>
</dict> </dict>
</plist> </plist>
` `
}
func entitlementsPlist() string { func entitlementsPlist() string {
return `<?xml version="1.0" encoding="UTF-8"?> return `<?xml version="1.0" encoding="UTF-8"?>
@@ -606,11 +591,11 @@ func entitlementsPlist() string {
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array><string>` + appID + `</string></array> <array><string>` + appID + `.golang.gotest</string></array>
<key>get-task-allow</key> <key>get-task-allow</key>
<true/> <true/>
<key>application-identifier</key> <key>application-identifier</key>
<string>` + appID + `</string> <string>` + appID + `.golang.gotest</string>
<key>com.apple.developer.team-identifier</key> <key>com.apple.developer.team-identifier</key>
<string>` + teamID + `</string> <string>` + teamID + `</string>
</dict> </dict>

View File

@@ -37,26 +37,6 @@ go src=..
testdata testdata
+ +
vendor vendor
github.com
google
pprof
internal
driver
testdata
+
graph
testdata
+
report
testdata
+
profile
testdata
+
ianlancetaylor
demangle
testdata
+
golang.org golang.org
x x
arch arch
@@ -162,8 +142,6 @@ go src=..
regexp regexp
testdata testdata
+ +
runtime
textflag.h
strconv strconv
testdata testdata
+ +

View File

@@ -158,15 +158,11 @@ func (fi headerFileInfo) Mode() (mode os.FileMode) {
// sysStat, if non-nil, populates h from system-dependent fields of fi. // sysStat, if non-nil, populates h from system-dependent fields of fi.
var sysStat func(fi os.FileInfo, h *Header) error var sysStat func(fi os.FileInfo, h *Header) error
// Mode constants from the tar spec.
const ( const (
// Mode constants from the USTAR spec: c_ISUID = 04000 // Set uid
// See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06 c_ISGID = 02000 // Set gid
c_ISUID = 04000 // Set uid c_ISVTX = 01000 // Save text (sticky bit)
c_ISGID = 02000 // Set gid
c_ISVTX = 01000 // Save text (sticky bit)
// Common Unix mode constants; these are not defined in any common tar standard.
// Header.FileInfo understands these, but FileInfoHeader will never produce these.
c_ISDIR = 040000 // Directory c_ISDIR = 040000 // Directory
c_ISFIFO = 010000 // FIFO c_ISFIFO = 010000 // FIFO
c_ISREG = 0100000 // Regular file c_ISREG = 0100000 // Regular file
@@ -212,24 +208,30 @@ func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) {
} }
switch { switch {
case fm.IsRegular(): case fm.IsRegular():
h.Mode |= c_ISREG
h.Typeflag = TypeReg h.Typeflag = TypeReg
h.Size = fi.Size() h.Size = fi.Size()
case fi.IsDir(): case fi.IsDir():
h.Typeflag = TypeDir h.Typeflag = TypeDir
h.Mode |= c_ISDIR
h.Name += "/" h.Name += "/"
case fm&os.ModeSymlink != 0: case fm&os.ModeSymlink != 0:
h.Typeflag = TypeSymlink h.Typeflag = TypeSymlink
h.Mode |= c_ISLNK
h.Linkname = link h.Linkname = link
case fm&os.ModeDevice != 0: case fm&os.ModeDevice != 0:
if fm&os.ModeCharDevice != 0 { if fm&os.ModeCharDevice != 0 {
h.Mode |= c_ISCHR
h.Typeflag = TypeChar h.Typeflag = TypeChar
} else { } else {
h.Mode |= c_ISBLK
h.Typeflag = TypeBlock h.Typeflag = TypeBlock
} }
case fm&os.ModeNamedPipe != 0: case fm&os.ModeNamedPipe != 0:
h.Typeflag = TypeFifo h.Typeflag = TypeFifo
h.Mode |= c_ISFIFO
case fm&os.ModeSocket != 0: case fm&os.ModeSocket != 0:
return nil, fmt.Errorf("archive/tar: sockets not supported") h.Mode |= c_ISSOCK
default: default:
return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm) return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm)
} }

View File

@@ -6,11 +6,9 @@ package tar
import ( import (
"bytes" "bytes"
"internal/testenv"
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
"path/filepath"
"reflect" "reflect"
"strings" "strings"
"testing" "testing"
@@ -29,7 +27,7 @@ func TestFileInfoHeader(t *testing.T) {
if g, e := h.Name, "small.txt"; g != e { if g, e := h.Name, "small.txt"; g != e {
t.Errorf("Name = %q; want %q", g, e) t.Errorf("Name = %q; want %q", g, e)
} }
if g, e := h.Mode, int64(fi.Mode().Perm()); g != e { if g, e := h.Mode, int64(fi.Mode().Perm())|c_ISREG; g != e {
t.Errorf("Mode = %#o; want %#o", g, e) t.Errorf("Mode = %#o; want %#o", g, e)
} }
if g, e := h.Size, int64(5); g != e { if g, e := h.Size, int64(5); g != e {
@@ -57,7 +55,7 @@ func TestFileInfoHeaderDir(t *testing.T) {
t.Errorf("Name = %q; want %q", g, e) t.Errorf("Name = %q; want %q", g, e)
} }
// Ignoring c_ISGID for golang.org/issue/4867 // Ignoring c_ISGID for golang.org/issue/4867
if g, e := h.Mode&^c_ISGID, int64(fi.Mode().Perm()); g != e { if g, e := h.Mode&^c_ISGID, int64(fi.Mode().Perm())|c_ISDIR; g != e {
t.Errorf("Mode = %#o; want %#o", g, e) t.Errorf("Mode = %#o; want %#o", g, e)
} }
if g, e := h.Size, int64(0); g != e { if g, e := h.Size, int64(0); g != e {
@@ -69,56 +67,40 @@ func TestFileInfoHeaderDir(t *testing.T) {
} }
func TestFileInfoHeaderSymlink(t *testing.T) { func TestFileInfoHeaderSymlink(t *testing.T) {
testenv.MustHaveSymlink(t) h, err := FileInfoHeader(symlink{}, "some-target")
tmpdir, err := ioutil.TempDir("", "TestFileInfoHeaderSymlink")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer os.RemoveAll(tmpdir) if g, e := h.Name, "some-symlink"; g != e {
link := filepath.Join(tmpdir, "link")
target := tmpdir
err = os.Symlink(target, link)
if err != nil {
t.Fatal(err)
}
fi, err := os.Lstat(link)
if err != nil {
t.Fatal(err)
}
h, err := FileInfoHeader(fi, target)
if err != nil {
t.Fatal(err)
}
if g, e := h.Name, fi.Name(); g != e {
t.Errorf("Name = %q; want %q", g, e) t.Errorf("Name = %q; want %q", g, e)
} }
if g, e := h.Linkname, target; g != e { if g, e := h.Linkname, "some-target"; g != e {
t.Errorf("Linkname = %q; want %q", g, e) t.Errorf("Linkname = %q; want %q", g, e)
} }
if g, e := h.Typeflag, byte(TypeSymlink); g != e {
t.Errorf("Typeflag = %v; want %v", g, e)
}
} }
type symlink struct{}
func (symlink) Name() string { return "some-symlink" }
func (symlink) Size() int64 { return 0 }
func (symlink) Mode() os.FileMode { return os.ModeSymlink }
func (symlink) ModTime() time.Time { return time.Time{} }
func (symlink) IsDir() bool { return false }
func (symlink) Sys() interface{} { return nil }
func TestRoundTrip(t *testing.T) { func TestRoundTrip(t *testing.T) {
data := []byte("some file contents") data := []byte("some file contents")
var b bytes.Buffer var b bytes.Buffer
tw := NewWriter(&b) tw := NewWriter(&b)
hdr := &Header{ hdr := &Header{
Name: "file.txt", Name: "file.txt",
Uid: 1 << 21, // too big for 8 octal digits Uid: 1 << 21, // too big for 8 octal digits
Size: int64(len(data)), Size: int64(len(data)),
// AddDate to strip monotonic clock reading, ModTime: time.Now(),
// and Round to discard sub-second precision,
// both of which are not included in the tar header
// and would otherwise break the round-trip check
// below.
ModTime: time.Now().AddDate(0, 0, 0).Round(1 * time.Second),
} }
// tar only supports second precision.
hdr.ModTime = hdr.ModTime.Add(-time.Duration(hdr.ModTime.Nanosecond()) * time.Nanosecond)
if err := tw.WriteHeader(hdr); err != nil { if err := tw.WriteHeader(hdr); err != nil {
t.Fatalf("tw.WriteHeader: %v", err) t.Fatalf("tw.WriteHeader: %v", err)
} }
@@ -157,7 +139,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// regular file. // regular file.
h: &Header{ h: &Header{
Name: "test.txt", Name: "test.txt",
Mode: 0644, Mode: 0644 | c_ISREG,
Size: 12, Size: 12,
ModTime: time.Unix(1360600916, 0), ModTime: time.Unix(1360600916, 0),
Typeflag: TypeReg, Typeflag: TypeReg,
@@ -167,7 +149,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// symbolic link. // symbolic link.
h: &Header{ h: &Header{
Name: "link.txt", Name: "link.txt",
Mode: 0777, Mode: 0777 | c_ISLNK,
Size: 0, Size: 0,
ModTime: time.Unix(1360600852, 0), ModTime: time.Unix(1360600852, 0),
Typeflag: TypeSymlink, Typeflag: TypeSymlink,
@@ -177,7 +159,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// character device node. // character device node.
h: &Header{ h: &Header{
Name: "dev/null", Name: "dev/null",
Mode: 0666, Mode: 0666 | c_ISCHR,
Size: 0, Size: 0,
ModTime: time.Unix(1360578951, 0), ModTime: time.Unix(1360578951, 0),
Typeflag: TypeChar, Typeflag: TypeChar,
@@ -187,7 +169,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// block device node. // block device node.
h: &Header{ h: &Header{
Name: "dev/sda", Name: "dev/sda",
Mode: 0660, Mode: 0660 | c_ISBLK,
Size: 0, Size: 0,
ModTime: time.Unix(1360578954, 0), ModTime: time.Unix(1360578954, 0),
Typeflag: TypeBlock, Typeflag: TypeBlock,
@@ -197,7 +179,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// directory. // directory.
h: &Header{ h: &Header{
Name: "dir/", Name: "dir/",
Mode: 0755, Mode: 0755 | c_ISDIR,
Size: 0, Size: 0,
ModTime: time.Unix(1360601116, 0), ModTime: time.Unix(1360601116, 0),
Typeflag: TypeDir, Typeflag: TypeDir,
@@ -207,7 +189,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// fifo node. // fifo node.
h: &Header{ h: &Header{
Name: "dev/initctl", Name: "dev/initctl",
Mode: 0600, Mode: 0600 | c_ISFIFO,
Size: 0, Size: 0,
ModTime: time.Unix(1360578949, 0), ModTime: time.Unix(1360578949, 0),
Typeflag: TypeFifo, Typeflag: TypeFifo,
@@ -217,7 +199,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// setuid. // setuid.
h: &Header{ h: &Header{
Name: "bin/su", Name: "bin/su",
Mode: 0755 | c_ISUID, Mode: 0755 | c_ISREG | c_ISUID,
Size: 23232, Size: 23232,
ModTime: time.Unix(1355405093, 0), ModTime: time.Unix(1355405093, 0),
Typeflag: TypeReg, Typeflag: TypeReg,
@@ -227,7 +209,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// setguid. // setguid.
h: &Header{ h: &Header{
Name: "group.txt", Name: "group.txt",
Mode: 0750 | c_ISGID, Mode: 0750 | c_ISREG | c_ISGID,
Size: 0, Size: 0,
ModTime: time.Unix(1360602346, 0), ModTime: time.Unix(1360602346, 0),
Typeflag: TypeReg, Typeflag: TypeReg,
@@ -237,7 +219,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// sticky. // sticky.
h: &Header{ h: &Header{
Name: "sticky.txt", Name: "sticky.txt",
Mode: 0600 | c_ISVTX, Mode: 0600 | c_ISREG | c_ISVTX,
Size: 7, Size: 7,
ModTime: time.Unix(1360602540, 0), ModTime: time.Unix(1360602540, 0),
Typeflag: TypeReg, Typeflag: TypeReg,
@@ -247,7 +229,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// hard link. // hard link.
h: &Header{ h: &Header{
Name: "hard.txt", Name: "hard.txt",
Mode: 0644, Mode: 0644 | c_ISREG,
Size: 0, Size: 0,
Linkname: "file.txt", Linkname: "file.txt",
ModTime: time.Unix(1360600916, 0), ModTime: time.Unix(1360600916, 0),
@@ -258,7 +240,7 @@ func TestHeaderRoundTrip(t *testing.T) {
// More information. // More information.
h: &Header{ h: &Header{
Name: "info.txt", Name: "info.txt",
Mode: 0600, Mode: 0600 | c_ISREG,
Size: 0, Size: 0,
Uid: 1000, Uid: 1000,
Gid: 1000, Gid: 1000,

Binary file not shown.

Binary file not shown.

View File

@@ -121,15 +121,9 @@ func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
needsPaxHeader := paxKeyword != paxNone && len(s) > len(b) || !isASCII(s) needsPaxHeader := paxKeyword != paxNone && len(s) > len(b) || !isASCII(s)
if needsPaxHeader { if needsPaxHeader {
paxHeaders[paxKeyword] = s paxHeaders[paxKeyword] = s
return
} }
f.formatString(b, s)
// Write string in a best-effort manner to satisfy readers that expect
// the field to be non-empty.
s = toASCII(s)
if len(s) > len(b) {
s = s[:len(b)]
}
f.formatString(b, s) // Should never error
} }
var formatNumeric = func(b []byte, x int64, paxKeyword string) { var formatNumeric = func(b []byte, x int64, paxKeyword string) {
// Try octal first. // Try octal first.

View File

@@ -103,46 +103,51 @@ func (r *pooledFlateReader) Close() error {
} }
var ( var (
compressors sync.Map // map[uint16]Compressor mu sync.RWMutex // guards compressor and decompressor maps
decompressors sync.Map // map[uint16]Decompressor
compressors = map[uint16]Compressor{
Store: func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil },
Deflate: func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil },
}
decompressors = map[uint16]Decompressor{
Store: ioutil.NopCloser,
Deflate: newFlateReader,
}
) )
func init() {
compressors.Store(Store, Compressor(func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil }))
compressors.Store(Deflate, Compressor(func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil }))
decompressors.Store(Store, Decompressor(ioutil.NopCloser))
decompressors.Store(Deflate, Decompressor(newFlateReader))
}
// RegisterDecompressor allows custom decompressors for a specified method ID. // RegisterDecompressor allows custom decompressors for a specified method ID.
// The common methods Store and Deflate are built in. // The common methods Store and Deflate are built in.
func RegisterDecompressor(method uint16, dcomp Decompressor) { func RegisterDecompressor(method uint16, dcomp Decompressor) {
if _, dup := decompressors.LoadOrStore(method, dcomp); dup { mu.Lock()
defer mu.Unlock()
if _, ok := decompressors[method]; ok {
panic("decompressor already registered") panic("decompressor already registered")
} }
decompressors[method] = dcomp
} }
// RegisterCompressor registers custom compressors for a specified method ID. // RegisterCompressor registers custom compressors for a specified method ID.
// The common methods Store and Deflate are built in. // The common methods Store and Deflate are built in.
func RegisterCompressor(method uint16, comp Compressor) { func RegisterCompressor(method uint16, comp Compressor) {
if _, dup := compressors.LoadOrStore(method, comp); dup { mu.Lock()
defer mu.Unlock()
if _, ok := compressors[method]; ok {
panic("compressor already registered") panic("compressor already registered")
} }
compressors[method] = comp
} }
func compressor(method uint16) Compressor { func compressor(method uint16) Compressor {
ci, ok := compressors.Load(method) mu.RLock()
if !ok { defer mu.RUnlock()
return nil return compressors[method]
}
return ci.(Compressor)
} }
func decompressor(method uint16) Decompressor { func decompressor(method uint16) Decompressor {
di, ok := decompressors.Load(method) mu.RLock()
if !ok { defer mu.RUnlock()
return nil return decompressors[method]
}
return di.(Decompressor)
} }

View File

@@ -5,7 +5,7 @@
/* /*
Package zip provides support for reading and writing ZIP archives. Package zip provides support for reading and writing ZIP archives.
See: https://www.pkware.com/appnote See: https://www.pkware.com/documents/casestudies/APPNOTE.TXT
This package does not support disk spanning. This package does not support disk spanning.

View File

@@ -11,9 +11,10 @@ import (
"hash" "hash"
"hash/crc32" "hash/crc32"
"io" "io"
"unicode/utf8"
) )
// TODO(adg): support zip file comments
// Writer implements a zip file writer. // Writer implements a zip file writer.
type Writer struct { type Writer struct {
cw *countWriter cw *countWriter
@@ -200,20 +201,6 @@ func (w *Writer) Create(name string) (io.Writer, error) {
return w.CreateHeader(header) return w.CreateHeader(header)
} }
func hasValidUTF8(s string) bool {
n := 0
for _, r := range s {
// By default, ZIP uses CP437, which is only identical to ASCII for the printable characters.
if r < 0x20 || r >= 0x7f {
if !utf8.ValidRune(r) {
return false
}
n++
}
}
return n > 0
}
// CreateHeader adds a file to the zip file using the provided FileHeader // CreateHeader adds a file to the zip file using the provided FileHeader
// for the file metadata. // for the file metadata.
// It returns a Writer to which the file contents should be written. // It returns a Writer to which the file contents should be written.
@@ -234,10 +221,6 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
fh.Flags |= 0x8 // we will write a data descriptor fh.Flags |= 0x8 // we will write a data descriptor
if hasValidUTF8(fh.Name) || hasValidUTF8(fh.Comment) {
fh.Flags |= 0x800 // filename or comment have valid utf-8 string
}
fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte
fh.ReaderVersion = zipVersion20 fh.ReaderVersion = zipVersion20

View File

@@ -87,69 +87,6 @@ func TestWriter(t *testing.T) {
} }
} }
func TestWriterUTF8(t *testing.T) {
var utf8Tests = []struct {
name string
comment string
expect uint16
}{
{
name: "hi, hello",
comment: "in the world",
expect: 0x8,
},
{
name: "hi, こんにちわ",
comment: "in the world",
expect: 0x808,
},
{
name: "hi, hello",
comment: "in the 世界",
expect: 0x808,
},
{
name: "hi, こんにちわ",
comment: "in the 世界",
expect: 0x808,
},
}
// write a zip file
buf := new(bytes.Buffer)
w := NewWriter(buf)
for _, test := range utf8Tests {
h := &FileHeader{
Name: test.name,
Comment: test.comment,
Method: Deflate,
}
w, err := w.CreateHeader(h)
if err != nil {
t.Fatal(err)
}
w.Write([]byte{})
}
if err := w.Close(); err != nil {
t.Fatal(err)
}
// read it back
r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
if err != nil {
t.Fatal(err)
}
for i, test := range utf8Tests {
got := r.File[i].Flags
t.Logf("name %v, comment %v", test.name, test.comment)
if got != test.expect {
t.Fatalf("Flags: got %v, want %v", got, test.expect)
}
}
}
func TestWriterOffset(t *testing.T) { func TestWriterOffset(t *testing.T) {
largeData := make([]byte, 1<<17) largeData := make([]byte, 1<<17)
for i := range largeData { for i := range largeData {
@@ -244,11 +181,12 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
} }
func BenchmarkCompressedZipGarbage(b *testing.B) { func BenchmarkCompressedZipGarbage(b *testing.B) {
b.ReportAllocs()
var buf bytes.Buffer
bigBuf := bytes.Repeat([]byte("a"), 1<<20) bigBuf := bytes.Repeat([]byte("a"), 1<<20)
for i := 0; i <= b.N; i++ {
runOnce := func(buf *bytes.Buffer) {
buf.Reset() buf.Reset()
zw := NewWriter(buf) zw := NewWriter(&buf)
for j := 0; j < 3; j++ { for j := 0; j < 3; j++ {
w, _ := zw.CreateHeader(&FileHeader{ w, _ := zw.CreateHeader(&FileHeader{
Name: "foo", Name: "foo",
@@ -257,19 +195,11 @@ func BenchmarkCompressedZipGarbage(b *testing.B) {
w.Write(bigBuf) w.Write(bigBuf)
} }
zw.Close() zw.Close()
} if i == 0 {
// Reset the timer after the first time through.
b.ReportAllocs() // This effectively discards the very large initial flate setup cost,
// Run once and then reset the timer. // as well as the initialization of bigBuf.
// This effectively discards the very large initial flate setup cost, b.ResetTimer()
// as well as the initialization of bigBuf.
runOnce(&bytes.Buffer{})
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
var buf bytes.Buffer
for pb.Next() {
runOnce(&buf)
} }
}) }
} }

View File

@@ -255,7 +255,7 @@ func TestZip64EdgeCase(t *testing.T) {
testZip64DirectoryRecordLength(buf, t) testZip64DirectoryRecordLength(buf, t)
} }
// Tests that we generate a zip64 file if the directory at offset // Tests that we generate a zip64 file if the the directory at offset
// 0xFFFFFFFF, but not before. // 0xFFFFFFFF, but not before.
func TestZip64DirectoryOffset(t *testing.T) { func TestZip64DirectoryOffset(t *testing.T) {
if testing.Short() && race.Enabled { if testing.Short() && race.Enabled {
@@ -681,18 +681,6 @@ func BenchmarkZip64Test(b *testing.B) {
} }
} }
func BenchmarkZip64TestSizes(b *testing.B) {
for _, size := range []int64{1 << 12, 1 << 20, 1 << 26} {
b.Run(fmt.Sprint(size), func(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
testZip64(b, size)
}
})
})
}
}
func TestSuffixSaver(t *testing.T) { func TestSuffixSaver(t *testing.T) {
const keep = 10 const keep = 10
ss := &suffixSaver{keep: keep} ss := &suffixSaver{keep: keep}

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer // Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer
// object, creating another object (Reader or Writer) that also implements // object, creating another object (Reader or Writer) that also implements
// the interface but provides buffering and some help for textual I/O. // the interface but provides buffering and some help for textual I/O.
package bufio package bufio
@@ -458,7 +458,6 @@ func (b *Reader) ReadString(delim byte) (string, error) {
} }
// WriteTo implements io.WriterTo. // WriteTo implements io.WriterTo.
// This may make multiple calls to the Read method of the underlying Reader.
func (b *Reader) WriteTo(w io.Writer) (n int64, err error) { func (b *Reader) WriteTo(w io.Writer) (n int64, err error) {
n, err = b.writeBuf(w) n, err = b.writeBuf(w)
if err != nil { if err != nil {
@@ -514,7 +513,7 @@ func (b *Reader) writeBuf(w io.Writer) (int64, error) {
// Writer implements buffering for an io.Writer object. // Writer implements buffering for an io.Writer object.
// If an error occurs writing to a Writer, no more data will be // If an error occurs writing to a Writer, no more data will be
// accepted and all subsequent writes, and Flush, will return the error. // accepted and all subsequent writes will return the error.
// After all data has been written, the client should call the // After all data has been written, the client should call the
// Flush method to guarantee all data has been forwarded to // Flush method to guarantee all data has been forwarded to
// the underlying io.Writer. // the underlying io.Writer.

Some files were not shown because too many files have changed in this diff Show More