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

|
||||
*Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].*
|
||||
|
||||
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.
|
||||
@@ -40,6 +39,3 @@ Note that the Go project does not use GitHub pull requests, and that
|
||||
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/
|
||||
[cc3-by]: https://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg math/big, type Word uintptr
|
||||
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
|
||||
pkg os (linux-arm), const O_SYNC = 4096
|
||||
pkg os (linux-arm-cgo), const O_SYNC = 4096
|
||||
|
||||
169
api/go1.9.txt
169
api/go1.9.txt
@@ -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
|
||||
@@ -20,7 +20,7 @@ trap cleanup 0 INT
|
||||
rm -f get.bin final-test.bin a.out
|
||||
|
||||
# If called with -all, check that all code snippets compile.
|
||||
if [ "$1" = "-all" ]; then
|
||||
if [ "$1" == "-all" ]; then
|
||||
for fn in *.go; do
|
||||
go build -o a.out $fn
|
||||
done
|
||||
|
||||
@@ -22,8 +22,6 @@ 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
|
||||
rather than an entire package: <code>go tool vet myprogram.go</code> as
|
||||
compared to <code>go vet mypackage</code>.
|
||||
Some of the commands, such as <code>pprof</code>, are accessible only through
|
||||
the go <code>tool</code> subcommand.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -62,7 +60,7 @@ details.
|
||||
</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> </td>
|
||||
<td>Cover is a program for creating and analyzing the coverage profiles
|
||||
generated by <code>"go test -coverprofile"</code>.</td>
|
||||
|
||||
@@ -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,
|
||||
<code>$home/go</code> on Plan 9,
|
||||
and <code>%USERPROFILE%\go</code> (usually <code>C:\Users\YourName\go</code>) on Windows.
|
||||
</p>
|
||||
|
||||
<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.
|
||||
If you would like to work in a different location, you will need to set
|
||||
<code>GOPATH</code> to the path to that directory.
|
||||
(Another common setup is to set <code>GOPATH=$HOME</code>.)
|
||||
Note that <code>GOPATH</code> must <b>not</b> be the
|
||||
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>
|
||||
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
|
||||
<code>$HOME/go/bin/hello</code>.
|
||||
<code>$HOME/work/bin/hello</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -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>
|
||||
|
||||
<ul>
|
||||
<li><a href="/doc/go1.9">Go 1.9</a> <small>(August 2017)</small></li>
|
||||
<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.6">Go 1.6</a> <small>(February 2016)</small></li>
|
||||
|
||||
@@ -30,25 +30,6 @@ You must go through the following process <em>prior to contributing</em>.
|
||||
You only need to do this once per Google Account.
|
||||
</p>
|
||||
|
||||
<h2 id="go-contrib-init">Automatically set up & diagnose your development environment</h3>
|
||||
<p>
|
||||
The <code>go-contrib-init</code> tool configures and debugs your Go
|
||||
development environment, automatically performing many of the steps
|
||||
on this page, or telling you what you need to do next. If you wish
|
||||
to use it, run:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get -u golang.org/x/tools/cmd/go-contrib-init
|
||||
$ cd /code/to/edit
|
||||
$ go-contrib-init
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The tool will either set things up, tell you that everything is
|
||||
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.
|
||||
@@ -137,10 +118,10 @@ it does not need to be completed again.</i>
|
||||
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.
|
||||
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,
|
||||
you can create one by clicking "New Contributor Agreement" and following the steps.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -324,10 +305,10 @@ Go to a directory where you want the source to appear and run the following
|
||||
command in a terminal.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre><code>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
$ cd go
|
||||
</pre>
|
||||
</code></pre>
|
||||
|
||||
<h3 id="master">Contributing to the main Go tree</h3>
|
||||
|
||||
@@ -415,9 +396,8 @@ and
|
||||
|
||||
<p>
|
||||
Once you have the changes queued up, you will want to commit them.
|
||||
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.
|
||||
In the Go contribution workflow this is done with a `git change` command,
|
||||
which creates a local branch and commits the changes directly to that local branch.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -438,9 +418,9 @@ then <code>git</code> <code>commit</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
As the <code>git</code> <code>commit</code> is the final step, Git will open an
|
||||
editor to ask for a commit message. (It uses the editor named by
|
||||
the <code>$EDITOR</code> environment variable,
|
||||
As the `git commit` is the final step, Git will open an editor to ask for a
|
||||
commit message.
|
||||
(It uses the editor named by the <code>$EDITOR</code> environment variable,
|
||||
<code>vi</code> by default.)
|
||||
|
||||
The file will look like:
|
||||
@@ -496,7 +476,7 @@ Fixes #159
|
||||
|
||||
<p>
|
||||
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
|
||||
the command and move that file to a different branch.
|
||||
</p>
|
||||
@@ -591,7 +571,7 @@ changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
|
||||
|
||||
<p>
|
||||
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>
|
||||
@@ -656,7 +636,7 @@ $ git mail
|
||||
|
||||
<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.
|
||||
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
|
||||
@@ -704,7 +684,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,
|
||||
stage those changes and use <code>git</code> <code>change</code> to update the
|
||||
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.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -15,38 +15,19 @@ git checkout <i>release-branch</i>
|
||||
<h2 id="policy">Release Policy</h2>
|
||||
|
||||
<p>
|
||||
Each major Go release is supported until there are two newer major releases.
|
||||
For example, Go 1.8 is supported until Go 1.10 is released,
|
||||
and Go 1.9 is supported until Go 1.11 is released.
|
||||
We fix critical problems, including <a href="/security">critical security problems</a>,
|
||||
in supported releases as needed by issuing minor revisions
|
||||
(for example, Go 1.9.1, Go 1.9.2, and so on).
|
||||
</p>
|
||||
|
||||
<h2 id="go1.9">go1.9 (released 2017/08/24)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.9 is a major release of Go.
|
||||
Read the <a href="/doc/go1.9">Go 1.9 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.9.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.9.1 (released 2017/10/04) includes two security fixes.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.1">Go
|
||||
1.9.1 milestone</a> on our issue tracker for details.
|
||||
Each major Go release obsoletes and ends support for the previous one.
|
||||
For example, if Go 1.5 has been released, then it is the current release
|
||||
and Go 1.4 and earlier are no longer supported.
|
||||
We fix critical problems in the current release as needed by issuing minor revisions
|
||||
(for example, Go 1.5.1, Go 1.5.2, and so on).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.9.2 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
|
||||
documentation, <code>go</code> command,
|
||||
and the <code>crypto/x509</code>, <code>database/sql</code>, <code>log</code>,
|
||||
and <code>net/smtp</code> packages.
|
||||
It includes a fix to a bug introduced in Go 1.9.1 that broke <code>go</code> <code>get</code>
|
||||
of non-Git repositories under certain conditions.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.2">Go
|
||||
1.9.2 milestone</a> on our issue tracker for details.
|
||||
As a special case, we issue minor revisions for critical security problems
|
||||
in both the current release and the previous release.
|
||||
For example, if Go 1.5 is the current release then we will issue minor revisions
|
||||
to fix critical security problems in both Go 1.4 and Go 1.5 as they arise.
|
||||
See the <a href="/security">security policy</a> for more details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
|
||||
@@ -82,13 +63,6 @@ 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>
|
||||
go1.8.4 (released 2017/10/04) includes two security fixes.
|
||||
It contains the same fixes as Go 1.9.1 and was released at the same time.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.4">Go
|
||||
1.8.4 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.7">go1.7 (released 2016/08/15)</h2>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -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.
|
||||
</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>
|
||||
<p>
|
||||
A document that gives tips for writing clear, idiomatic Go code.
|
||||
|
||||
231
doc/editors.html
231
doc/editors.html
@@ -1,231 +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</a>: vim-go plugin provides Go programming language support</li>
|
||||
<li><a href="https://marketplace.visualstudio.com/items?itemName=lukehoban.Go">Visual Studio Code</a>:
|
||||
Go extension provides 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 commercial IntelliJ Platform IDEs</li>
|
||||
<li><a href="https://atom.io/packages/go-plus">Atom</a>: Go-Plus is an Atom package that provides enhanced Go support</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</th>
|
||||
<th><img title="Visual Studio Code" src="/doc/editors/vscodego.png"><br>Visual Studio Code</th>
|
||||
<th><img title="Gogland" src="/doc/editors/gogland.png"><br>Gogland</th>
|
||||
<th><img title="Go-Plus" src="/doc/editors/go-plus.png"><br>Atom</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-row" colspan="5">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>
|
||||
<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>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type-aware autocompletion</td>
|
||||
<td class="no">No</td>
|
||||
<td class="no">No</td>
|
||||
<td class="yes">Yes</td>
|
||||
<td class="no">No</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rename identifiers</td>
|
||||
<td class="yes">Yes</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>
|
||||
<td class="yes">Yes</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>
|
||||
<td class="yes">Yes</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>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-row" colspan="5">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>
|
||||
<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>
|
||||
<td class="yes">No</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>
|
||||
<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>
|
||||
<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>
|
||||
<td class="yes">Yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="feature-row" colspan="5">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>
|
||||
<td class="yes">Yes<sup>3</sup></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>
|
||||
<td class="no">No</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>
|
||||
<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>
|
||||
<td class="yes">Yes<sup>3</sup></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Display test coverage</td>
|
||||
<td class="yes">Yes</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>
|
||||
<td><a href="https://atom.io/packages/go-plus">Install</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<sup>1</sup>Possible when enabled via Settings > Go > 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.
|
||||
<br>
|
||||
<sup>3</sup>Available if the <a href="https://atom.io/packages/go-debug">go-debug</a> package is installed.
|
||||
</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>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
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 |
@@ -1580,7 +1580,7 @@ if attended[person] { // will be false if person is not in the map
|
||||
<p>
|
||||
Sometimes you need to distinguish a missing entry from
|
||||
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.
|
||||
</p>
|
||||
<pre>
|
||||
@@ -1833,7 +1833,7 @@ for a min function that chooses the least of a list of integers:
|
||||
</p>
|
||||
<pre>
|
||||
func Min(a ...int) int {
|
||||
min := int(^uint(0) >> 1) // largest int
|
||||
min := int(^uint(0) >> 1) // largest int
|
||||
for _, i := range a {
|
||||
if i < min {
|
||||
min = i
|
||||
|
||||
55
doc/go1.8.txt
Normal file
55
doc/go1.8.txt
Normal 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)
|
||||
1019
doc/go1.9.html
1019
doc/go1.9.html
File diff suppressed because it is too large
Load Diff
@@ -1140,7 +1140,7 @@ program is one tool to help automate this process.
|
||||
</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
|
||||
that makes it easier to manage external dependencies by "vendoring"
|
||||
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.
|
||||
</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>
|
||||
|
||||
<h3 id="pass_by_value">
|
||||
|
||||
236
doc/go_spec.html
236
doc/go_spec.html
@@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of June 28, 2017",
|
||||
"Subtitle": "Version of January 31, 2017",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
@@ -154,7 +154,7 @@ Any other comment acts like a newline.
|
||||
<p>
|
||||
Tokens form the vocabulary of the Go language.
|
||||
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),
|
||||
carriage returns (U+000D), and newlines (U+000A),
|
||||
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>
|
||||
</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>,
|
||||
@@ -254,11 +254,10 @@ const fallthrough if range type
|
||||
continue for import return var
|
||||
</pre>
|
||||
|
||||
<h3 id="Operators_and_punctuation">Operators and punctuation</h3>
|
||||
<h3 id="Operators_and_Delimiters">Operators and Delimiters</h3>
|
||||
|
||||
<p>
|
||||
The following character sequences represent <a href="#Operators">operators</a>
|
||||
(including <a href="#assign_op">assignment operators</a>) and punctuation:
|
||||
The following character sequences represent <a href="#Operators">operators</a>, delimiters, and other special tokens:
|
||||
</p>
|
||||
<pre class="grammar">
|
||||
+ & += &= && == != ( )
|
||||
@@ -686,9 +685,11 @@ If a variable has not yet been assigned a value, its value is the
|
||||
<h2 id="Types">Types</h2>
|
||||
|
||||
<p>
|
||||
A type determines a set of values together with operations and methods specific
|
||||
to those values. A type may be denoted by a <i>type name</i>, if it has one,
|
||||
or specified using a <i>type literal</i>, which composes a type from existing types.
|
||||
A type determines the set of values and operations specific to values of that
|
||||
type. Types may be <i>named</i> or <i>unnamed</i>. Named types are specified
|
||||
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>
|
||||
|
||||
<pre class="ebnf">
|
||||
@@ -701,7 +702,6 @@ TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType
|
||||
<p>
|
||||
Named instances of the boolean, numeric, and string types are
|
||||
<a href="#Predeclared_identifiers">predeclared</a>.
|
||||
Other named types are introduced with <a href="#Type_declarations">type declarations</a>.
|
||||
<i>Composite types</i>—array, struct, pointer, function,
|
||||
interface, slice, map, and channel types—may be constructed using
|
||||
type literals.
|
||||
@@ -717,23 +717,16 @@ is the underlying type of the type to which <code>T</code> refers in its
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
type (
|
||||
A1 = string
|
||||
A2 = A1
|
||||
)
|
||||
|
||||
type (
|
||||
B1 string
|
||||
B2 B1
|
||||
B3 []B1
|
||||
B4 B3
|
||||
)
|
||||
type T1 string
|
||||
type T2 T1
|
||||
type T3 []T1
|
||||
type T4 T3
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The underlying type of <code>string</code>, <code>A1</code>, <code>A2</code>, <code>B1</code>,
|
||||
and <code>B2</code> is <code>string</code>.
|
||||
The underlying type of <code>[]B1</code>, <code>B3</code>, and <code>B4</code> is <code>[]B1</code>.
|
||||
The underlying type of <code>string</code>, <code>T1</code>, and <code>T2</code>
|
||||
is <code>string</code>. The underlying type of <code>[]T1</code>, <code>T3</code>,
|
||||
and <code>T4</code> is <code>[]T1</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="Method_sets">Method sets</h3>
|
||||
@@ -1424,10 +1417,11 @@ Two types are either <i>identical</i> or <i>different</i>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <a href="#Type_definitions">defined type</a> is always different from any other type.
|
||||
Otherwise, two types are identical if their <a href="#Types">underlying</a> type literals are
|
||||
structurally equivalent; that is, they have the same literal structure and corresponding
|
||||
components have identical types. In detail:
|
||||
Two <a href="#Types">named types</a> are identical if their type names originate in the same
|
||||
<a href="#Type_declarations">TypeSpec</a>.
|
||||
A named and an <a href="#Types">unnamed type</a> are always different. Two unnamed types are identical
|
||||
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>
|
||||
|
||||
<ul>
|
||||
@@ -1466,24 +1460,13 @@ Given the declarations
|
||||
|
||||
<pre>
|
||||
type (
|
||||
A0 = []string
|
||||
A1 = A0
|
||||
A2 = struct{ a, b int }
|
||||
A3 = int
|
||||
A4 = func(A3, float64) *A0
|
||||
A5 = func(x int, _ float64) *[]string
|
||||
T0 []string
|
||||
T1 []string
|
||||
T2 struct{ a, b int }
|
||||
T3 struct{ a, c int }
|
||||
T4 func(int, float64) *T0
|
||||
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>
|
||||
|
||||
<p>
|
||||
@@ -1491,22 +1474,17 @@ these types are identical:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
A0, A1, and []string
|
||||
A2 and struct{ a, b int }
|
||||
A3 and int
|
||||
A4, func(int, float64) *[]string, and A5
|
||||
|
||||
B0, B0, and C0
|
||||
T0 and T0
|
||||
[]int and []int
|
||||
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>
|
||||
|
||||
<p>
|
||||
<code>B0</code> and <code>B1</code> are different because they are new types
|
||||
created by distinct <a href="#Type_definitions">type definitions</a>;
|
||||
<code>func(int, float64) *B0</code> and <code>func(x int, y float64) *[]string</code>
|
||||
are different because <code>B0</code> is different from <code>[]string</code>.
|
||||
<code>T0</code> and <code>T1</code> are different because they are named types
|
||||
with distinct declarations; <code>func(int, float64) *T0</code> and
|
||||
<code>func(x int, y float64) *[]string</code> are different because <code>T0</code>
|
||||
is different from <code>[]string</code>.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1524,7 +1502,7 @@ A value <code>x</code> is <i>assignable</i> to a <a href="#Variables">variable</
|
||||
<li>
|
||||
<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>
|
||||
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>
|
||||
<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>
|
||||
<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,
|
||||
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>
|
||||
<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>
|
||||
|
||||
<p>
|
||||
A type declaration binds an identifier, the <i>type name</i>, to a <a href="#Types">type</a>.
|
||||
Type declarations come in two forms: alias declarations and type definitions.
|
||||
<p>
|
||||
|
||||
<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.
|
||||
A type declaration binds an identifier, the <i>type name</i>, to a new type
|
||||
that has the same <a href="#Types">underlying type</a> as an existing type,
|
||||
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.
|
||||
</p>
|
||||
|
||||
<pre class="ebnf">
|
||||
AliasDecl = identifier "=" Type .
|
||||
TypeDecl = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
|
||||
TypeSpec = identifier Type .
|
||||
</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>
|
||||
type IntArray [16]int
|
||||
|
||||
type (
|
||||
nodeList = []*Node // nodeList and []*Node are identical types
|
||||
Polar = polar // Polar and polar denote identical types
|
||||
)
|
||||
</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
|
||||
Point struct{ x, y float64 }
|
||||
Polar Point
|
||||
)
|
||||
|
||||
type TreeNode struct {
|
||||
@@ -1931,9 +1872,8 @@ type Block interface {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A defined type may have <a href="#Method_declarations">methods</a> associated with it.
|
||||
It does not inherit any methods bound to the given type,
|
||||
but the <a href="#Method_sets">method set</a>
|
||||
The declared type does not inherit any <a href="#Method_declarations">methods</a>
|
||||
bound to the existing type, but the <a href="#Method_sets">method set</a>
|
||||
of an interface type or of elements of a composite type remains unchanged:
|
||||
</p>
|
||||
|
||||
@@ -1961,8 +1901,8 @@ type MyBlock Block
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Type definitions may be used to define different boolean, numeric,
|
||||
or string types and associate methods with them:
|
||||
A type declaration may be used to define a different boolean, numeric, or string
|
||||
type and attach methods to it:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -1984,8 +1924,8 @@ func (tz TimeZone) String() string {
|
||||
<h3 id="Variable_declarations">Variable declarations</h3>
|
||||
|
||||
<p>
|
||||
A variable declaration creates one or more <a href="#Variables">variables</a>,
|
||||
binds corresponding identifiers to them, and gives each a type and an initial value.
|
||||
A variable declaration creates one or more variables, binds corresponding
|
||||
identifiers to them, and gives each a type and an initial value.
|
||||
</p>
|
||||
|
||||
<pre class="ebnf">
|
||||
@@ -2143,8 +2083,8 @@ and associates the method with the receiver's <i>base type</i>.
|
||||
</p>
|
||||
|
||||
<pre class="ebnf">
|
||||
MethodDecl = "func" Receiver MethodName ( Function | Signature ) .
|
||||
Receiver = Parameters .
|
||||
MethodDecl = "func" Receiver MethodName ( Function | Signature ) .
|
||||
Receiver = Parameters .
|
||||
</pre>
|
||||
|
||||
<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
|
||||
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
|
||||
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
|
||||
is visible only within <a href="#Selectors">selectors</a> for type <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.
|
||||
For map literals, all elements must have a key. It is an error
|
||||
to specify multiple elements with the same field name or
|
||||
constant key value. For non-constant map keys, see the section on
|
||||
<a href="#Order_of_evaluation">evaluation order</a>.
|
||||
constant key value.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -3384,7 +3323,7 @@ to the type of the other operand.
|
||||
|
||||
<p>
|
||||
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,
|
||||
it is first converted to the type it would assume if the shift expression were
|
||||
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.
|
||||
</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>
|
||||
|
||||
@@ -3667,7 +3579,7 @@ These terms and the result of the comparisons are defined as follows:
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Floating-point values are comparable and ordered,
|
||||
Floating point values are comparable and ordered,
|
||||
as defined by the IEEE-754 standard.
|
||||
</li>
|
||||
|
||||
@@ -3937,8 +3849,7 @@ in any of these cases:
|
||||
</li>
|
||||
<li>
|
||||
ignoring struct tags (see below),
|
||||
<code>x</code>'s type and <code>T</code> are pointer types
|
||||
that are not <a href="#Type_definitions">defined types</a>,
|
||||
<code>x</code>'s type and <code>T</code> are unnamed pointer types
|
||||
and their pointer base types have identical underlying types.
|
||||
</li>
|
||||
<li>
|
||||
@@ -4523,8 +4434,8 @@ a[i] = 23
|
||||
|
||||
<p>
|
||||
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>
|
||||
is equivalent to <code>x</code> <code>=</code> <code>x</code> <i>op</i>
|
||||
<code>y</code> where <i>op</i> is a binary arithmetic operation is equivalent
|
||||
to <code>x</code> <code>=</code> <code>x</code> <i>op</i>
|
||||
<code>(y)</code> but evaluates <code>x</code>
|
||||
only once. The <i>op</i><code>=</code> construct is a single token.
|
||||
In assignment operations, both the left- and right-hand expression lists
|
||||
@@ -5025,8 +4936,8 @@ a single byte in the string.
|
||||
<li>
|
||||
The iteration order over maps is not specified
|
||||
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,
|
||||
the corresponding iteration value will not be produced. If a map entry is
|
||||
If map entries that have not yet been reached are removed during iteration,
|
||||
the corresponding iteration values will not be produced. If map entries are
|
||||
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
|
||||
iteration to the next.
|
||||
@@ -5126,7 +5037,7 @@ function completes.
|
||||
|
||||
<pre>
|
||||
go Server()
|
||||
go func(ch chan<- bool) { for { sleep(10); ch <- true }} (c)
|
||||
go func(ch chan<- bool) { for { sleep(10); ch <- true; }} (c)
|
||||
</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) 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, 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<<63) // illegal: len(s) is not representable by a value of type int
|
||||
s := make([]int, 10, 0) // illegal: len(s) > cap(s)
|
||||
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>
|
||||
|
||||
<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>
|
||||
|
||||
@@ -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
|
||||
</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>
|
||||
|
||||
@@ -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>
|
||||
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
|
||||
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.
|
||||
</p>
|
||||
|
||||
@@ -6509,7 +6409,7 @@ The following minimal alignment properties are guaranteed:
|
||||
</li>
|
||||
|
||||
<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>
|
||||
</ol>
|
||||
|
||||
|
||||
@@ -59,12 +59,6 @@ The <a href="https://reddit.com/r/golang">golang sub-Reddit</a> is a place
|
||||
for Go news and discussion.
|
||||
</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>
|
||||
|
||||
<h3 id="go_user_groups"><a href="/wiki/GoUserGroups">Go User Groups</a></h3>
|
||||
|
||||
@@ -143,7 +143,7 @@ packaged Go distribution.
|
||||
<p>
|
||||
To build a bootstrap tool chain from source, use
|
||||
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
|
||||
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.)
|
||||
@@ -221,7 +221,7 @@ To build without <code>cgo</code>, set the environment variable
|
||||
Change to the directory that will be its parent
|
||||
and make sure the <code>go</code> directory does not exist.
|
||||
Then clone the repository and check out the latest release tag
|
||||
(<code class="versionTag">go1.9</code>, for example):</p>
|
||||
(<code class="versionTag">go1.8.1</code>, for example):</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
@@ -409,7 +409,7 @@ New releases are announced on the
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>
|
||||
mailing list.
|
||||
Each announcement mentions the latest release tag, for instance,
|
||||
<code class="versionTag">go1.9</code>.
|
||||
<code class="versionTag">go1.8.1</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -33,7 +33,7 @@ system and architecture, try
|
||||
<h2 id="requirements">System requirements</h2>
|
||||
|
||||
<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.
|
||||
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
|
||||
@@ -47,10 +47,10 @@ If your OS or architecture is not on the list, you may be able to
|
||||
<th align="center">Notes</th>
|
||||
</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 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>macOS 10.8 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</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>†</sup>. No need for cygwin or msys.</td></tr>
|
||||
<tr><td>FreeBSD 8-STABLE or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</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>Mac OS X 10.8 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>†</sup> that comes with Xcode<sup>‡</sup> for <code>cgo</code> support</td></tr>
|
||||
<tr><td>Windows XP or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>†</sup>. No need for cygwin or msys.</td></tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
@@ -222,7 +222,8 @@ and building a simple program, as follows.
|
||||
Create your <a href="code.html#Workspaces">workspace</a> directory,
|
||||
<code class="testUnix">$HOME/go</code><code class="testWindows">%USERPROFILE%\go</code>.
|
||||
(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>
|
||||
|
||||
144
doc/root.html
144
doc/root.html
@@ -6,9 +6,7 @@
|
||||
<div class="left">
|
||||
|
||||
<div id="learn">
|
||||
{{if not $.GoogleCN}}
|
||||
<a class="popout share">Pop-out</a>
|
||||
{{end}}
|
||||
<div class="rootHeading">Try Go</div>
|
||||
<div class="input">
|
||||
<textarea spellcheck="false" class="code">// You can edit this code!
|
||||
@@ -28,10 +26,10 @@ Hello, 世界
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a class="run" href="#" title="Run this code [shift-enter]">Run</a>
|
||||
{{if not $.GoogleCN}}
|
||||
{{if $.Share}}
|
||||
<a class="share" href="#" title="Share this code">Share</a>
|
||||
<a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a>
|
||||
{{end}}
|
||||
<a class="tour" href="//tour.golang.org/" title="Learn Go from your browser">Tour</a>
|
||||
</div>
|
||||
<div class="toys">
|
||||
<select>
|
||||
@@ -70,91 +68,85 @@ Linux, Mac OS X, Windows, and more.
|
||||
|
||||
<div style="clear: both"></div>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<div class="left">
|
||||
<div id="video">
|
||||
<div class="rootHeading">Featured video</div>
|
||||
<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
<div id="video">
|
||||
<div class="rootHeading">Featured video</div>
|
||||
<iframe width="415" height="241" src="//www.youtube.com/embed/ytEkHepK08c" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<div id="blog">
|
||||
<div class="rootHeading">Featured articles</div>
|
||||
<div class="read"><a href="//blog.golang.org/">Read more</a></div>
|
||||
</div>
|
||||
|
||||
<div id="blog">
|
||||
<div class="rootHeading">Featured articles</div>
|
||||
<div class="read"><a href="//blog.golang.org/">Read more</a></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div style="clear: both;"></div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
'use strict';
|
||||
<script type="text/javascript">
|
||||
|
||||
window.initFuncs.push(function() {
|
||||
// Set up playground if enabled.
|
||||
if (window.playground) {
|
||||
window.playground({
|
||||
"codeEl": "#learn .code",
|
||||
"outputEl": "#learn .output",
|
||||
"runEl": "#learn .run",
|
||||
"shareEl": "#learn .share",
|
||||
"shareRedirect": "//play.golang.org/p/",
|
||||
"toysEl": "#learn .toys select"
|
||||
});
|
||||
} else {
|
||||
$('#learn').hide()
|
||||
}
|
||||
});
|
||||
function readableTime(t) {
|
||||
var m = ["January", "February", "March", "April", "May", "June", "July",
|
||||
"August", "September", "October", "November", "December"];
|
||||
var p = t.substring(0, t.indexOf("T")).split("-");
|
||||
var d = new Date(p[0], p[1]-1, p[2]);
|
||||
return d.getDate() + " " + m[d.getMonth()] + " " + d.getFullYear();
|
||||
}
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
function feedLoaded(result) {
|
||||
var blog = document.getElementById("blog");
|
||||
var read = blog.getElementsByClassName("read")[0];
|
||||
for (var i = 0; i < result.length && i < 2; i++) {
|
||||
var entry = result[i];
|
||||
var title = document.createElement("a");
|
||||
title.className = "title";
|
||||
title.href = entry.Link;
|
||||
title.innerHTML = entry.Title;
|
||||
blog.insertBefore(title, read);
|
||||
var extract = document.createElement("div");
|
||||
extract.className = "extract";
|
||||
extract.innerHTML = entry.Summary;
|
||||
blog.insertBefore(extract, read);
|
||||
var when = document.createElement("div");
|
||||
when.className = "when";
|
||||
when.innerHTML = "Published " + readableTime(entry.Time);
|
||||
blog.insertBefore(when, read);
|
||||
}
|
||||
}
|
||||
|
||||
function readableTime(t) {
|
||||
var m = ["January", "February", "March", "April", "May", "June", "July",
|
||||
"August", "September", "October", "November", "December"];
|
||||
var p = t.substring(0, t.indexOf("T")).split("-");
|
||||
var d = new Date(p[0], p[1]-1, p[2]);
|
||||
return d.getDate() + " " + m[d.getMonth()] + " " + d.getFullYear();
|
||||
window.initFuncs.push(function() {
|
||||
// Set up playground if enabled.
|
||||
if (window.playground) {
|
||||
window.playground({
|
||||
"codeEl": "#learn .code",
|
||||
"outputEl": "#learn .output",
|
||||
"runEl": "#learn .run",
|
||||
"shareEl": "#learn .share",
|
||||
"shareRedirect": "//play.golang.org/p/",
|
||||
"toysEl": "#learn .toys select"
|
||||
});
|
||||
} else {
|
||||
$('#learn').hide()
|
||||
}
|
||||
|
||||
window.feedLoaded = function(result) {
|
||||
var blog = document.getElementById("blog");
|
||||
var read = blog.getElementsByClassName("read")[0];
|
||||
for (var i = 0; i < result.length && i < 2; i++) {
|
||||
var entry = result[i];
|
||||
var title = document.createElement("a");
|
||||
title.className = "title";
|
||||
title.href = entry.Link;
|
||||
title.innerHTML = entry.Title;
|
||||
blog.insertBefore(title, read);
|
||||
var extract = document.createElement("div");
|
||||
extract.className = "extract";
|
||||
extract.innerHTML = entry.Summary;
|
||||
blog.insertBefore(extract, read);
|
||||
var when = document.createElement("div");
|
||||
when.className = "when";
|
||||
when.innerHTML = "Published " + readableTime(entry.Time);
|
||||
blog.insertBefore(when, read);
|
||||
}
|
||||
}
|
||||
// Load blog feed.
|
||||
$('<script/>').attr('text', 'text/javascript')
|
||||
.attr('src', '//blog.golang.org/.json?jsonp=feedLoaded')
|
||||
.appendTo('body');
|
||||
|
||||
window.initFuncs.push(function() {
|
||||
// Load blog feed.
|
||||
$('<script/>').attr('text', 'text/javascript')
|
||||
.attr('src', '//blog.golang.org/.json?jsonp=feedLoaded')
|
||||
.appendTo('body');
|
||||
// Set the video at random.
|
||||
var videos = [
|
||||
{h: 241, s: "//www.youtube.com/embed/ytEkHepK08c"}, // Tour of Go
|
||||
{h: 241, s: "//www.youtube.com/embed/f6kdp27TYZs"}, // Concurrency Patterns
|
||||
{h: 233, s: "//player.vimeo.com/video/69237265"} // Simple environment
|
||||
];
|
||||
var v = videos[Math.floor(Math.random()*videos.length)];
|
||||
$('#video iframe').attr('height', v.h).attr('src', v.s);
|
||||
});
|
||||
|
||||
// Set the video at random.
|
||||
var videos = [
|
||||
{h: 241, s: "//www.youtube.com/embed/ytEkHepK08c"}, // Tour of Go
|
||||
{h: 241, s: "//www.youtube.com/embed/f6kdp27TYZs"}, // Concurrency Patterns
|
||||
{h: 233, s: "//player.vimeo.com/video/69237265"} // Simple environment
|
||||
];
|
||||
var v = videos[Math.floor(Math.random()*videos.length)];
|
||||
$('#video iframe').attr('height', v.h).attr('src', v.s);
|
||||
});
|
||||
|
||||
{{end}}
|
||||
})();
|
||||
</script>
|
||||
|
||||
@@ -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
|
||||
detailed response to your email within 72 hours indicating the next steps in
|
||||
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>
|
||||
@@ -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>
|
||||
|
||||
<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>
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Comment: GPGTools - https://gpgtools.org
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# Consult http://www.iana.org/time-zones for the latest versions.
|
||||
|
||||
# Versions to use.
|
||||
CODE=2017b
|
||||
DATA=2017b
|
||||
CODE=2016j
|
||||
DATA=2016j
|
||||
|
||||
set -e
|
||||
rm -rf work
|
||||
@@ -42,7 +42,7 @@ zip -0 -r ../../zoneinfo.zip *
|
||||
cd ../..
|
||||
|
||||
echo
|
||||
if [ "$1" = "-work" ]; then
|
||||
if [ "$1" == "-work" ]; then
|
||||
echo Left workspace behind in work/.
|
||||
else
|
||||
rm -rf work
|
||||
|
||||
Binary file not shown.
@@ -24,16 +24,7 @@ func run(args ...string) string {
|
||||
buf := new(bytes.Buffer)
|
||||
cmd := exec.Command("adb", args...)
|
||||
cmd.Stdout = io.MultiWriter(os.Stdout, buf)
|
||||
// If the adb subprocess somehow hangs, go test will kill this wrapper
|
||||
// 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}
|
||||
cmd.Stderr = os.Stderr
|
||||
log.Printf("adb %s", strings.Join(args, " "))
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package main
|
||||
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
_ = C.malloc // ERROR HERE
|
||||
}
|
||||
@@ -343,14 +343,6 @@ var ptrTests = []ptrTest{
|
||||
body: `var b C.char; p := &b; C.f((*C.u)(unsafe.Pointer(&p)))`,
|
||||
fail: false,
|
||||
},
|
||||
{
|
||||
// Issue #21306.
|
||||
name: "preempt-during-call",
|
||||
c: `void f() {}`,
|
||||
imports: []string{"runtime", "sync"},
|
||||
body: `var wg sync.WaitGroup; wg.Add(100); for i := 0; i < 100; i++ { go func(i int) { for j := 0; j < 100; j++ { C.f(); runtime.GOMAXPROCS(i) }; wg.Done() }(i) }; wg.Wait()`,
|
||||
fail: false,
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -17,7 +17,7 @@ check() {
|
||||
expect() {
|
||||
file=$1
|
||||
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
|
||||
exit 1
|
||||
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 issue16116.go
|
||||
check issue16591.go
|
||||
check issue18889.go
|
||||
expect issue18452.go issue18452.go:16 issue18452.go:17
|
||||
|
||||
if ! go build issue14669.go; then
|
||||
exit 1
|
||||
|
||||
@@ -12,7 +12,7 @@ FC=$1
|
||||
goos=$(go env GOOS)
|
||||
|
||||
libext="so"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
if [ "$goos" == "darwin" ]; then
|
||||
libext="dylib"
|
||||
fi
|
||||
|
||||
|
||||
@@ -76,10 +76,5 @@ func TestThreadLock(t *testing.T) { testThreadLockFunc(t) }
|
||||
func TestCheckConst(t *testing.T) { testCheckConst(t) }
|
||||
func Test17537(t *testing.T) { test17537(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 Test21708(t *testing.T) { test21708(t) }
|
||||
|
||||
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
// Fail to guess the kind of the constant "x".
|
||||
// No runtime test; just make sure it compiles.
|
||||
|
||||
package cgotest
|
||||
|
||||
// const int x = 42;
|
||||
import "C"
|
||||
|
||||
var issue21668_X = C.x
|
||||
@@ -1,16 +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
|
||||
|
||||
// #include <stdint.h>
|
||||
// #define CAST_TO_INT64 (int64_t)(-1)
|
||||
import "C"
|
||||
import "testing"
|
||||
|
||||
func test21708(t *testing.T) {
|
||||
if got, want := C.CAST_TO_INT64, -1; got != want {
|
||||
t.Errorf("C.CAST_TO_INT64 == %v, expected %v", got, want)
|
||||
}
|
||||
}
|
||||
@@ -74,15 +74,18 @@ func testNaming(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
// This would be nice, but it has never worked.
|
||||
/*
|
||||
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)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if s := C.mystring_def; s != "hello" {
|
||||
t.Errorf("C.mystring_def = %q, want %q", s, "hello")
|
||||
|
||||
@@ -115,10 +115,8 @@ func init() {
|
||||
func goEnv(key string) string {
|
||||
out, err := exec.Command("go", "env", key).Output()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "go env %s failed:\n%s\n", key, err)
|
||||
if ee, ok := err.(*exec.ExitError); ok {
|
||||
fmt.Fprintf(os.Stderr, "%s", ee.Stderr)
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "go env %s failed:\n%s", key, err)
|
||||
fmt.Fprintf(os.Stderr, "%s", err.(*exec.ExitError).Stderr)
|
||||
os.Exit(2)
|
||||
}
|
||||
return strings.TrimSpace(string(out))
|
||||
@@ -220,7 +218,15 @@ func TestEarlySignalHandler(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() {
|
||||
os.Remove("libgo2.a")
|
||||
@@ -245,19 +251,32 @@ func TestSignalForwarding(t *testing.T) {
|
||||
cmd = exec.Command(bin[0], append(bin[1:], "1")...)
|
||||
|
||||
out, err := cmd.CombinedOutput()
|
||||
t.Logf("%s", out)
|
||||
expectSignal(t, err, syscall.SIGSEGV)
|
||||
|
||||
// Test SIGPIPE forwarding
|
||||
cmd = exec.Command(bin[0], append(bin[1:], "3")...)
|
||||
|
||||
out, err = cmd.CombinedOutput()
|
||||
t.Logf("%s", out)
|
||||
expectSignal(t, err, syscall.SIGPIPE)
|
||||
if err == nil {
|
||||
t.Logf("%s", out)
|
||||
t.Error("test program succeeded unexpectedly")
|
||||
} else if ee, ok := err.(*exec.ExitError); !ok {
|
||||
t.Logf("%s", out)
|
||||
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) {
|
||||
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() {
|
||||
os.Remove("libgo2.a")
|
||||
@@ -325,7 +344,14 @@ func TestSignalForwardingExternal(t *testing.T) {
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -333,38 +359,6 @@ func TestSignalForwardingExternal(t *testing.T) {
|
||||
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) {
|
||||
switch GOOS {
|
||||
case "windows":
|
||||
@@ -544,79 +538,3 @@ func hasDynTag(t *testing.T, f *elf.File, tag elf.DynTag) bool {
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#include <time.h>
|
||||
#include <errno.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 sigpipeSeen;
|
||||
|
||||
// Use up some stack space.
|
||||
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.
|
||||
static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
|
||||
char a[1024];
|
||||
@@ -112,10 +106,6 @@ static void init() {
|
||||
die("sigaction");
|
||||
}
|
||||
|
||||
sa.sa_sigaction = pipeHandler;
|
||||
if (sigaction(SIGPIPE, &sa, NULL) < 0) {
|
||||
die("sigaction");
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
@@ -177,30 +167,7 @@ int main(int argc, char** argv) {
|
||||
nanosleep(&ts, NULL);
|
||||
i++;
|
||||
if (i > 5000) {
|
||||
fprintf(stderr, "looping too long waiting for SIGIO\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");
|
||||
fprintf(stderr, "looping too long waiting for signal\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libgo3.h"
|
||||
|
||||
@@ -26,31 +25,6 @@ static void ioHandler(int signo, siginfo_t* info, void* ctxt) {
|
||||
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 verbose;
|
||||
struct sigaction sa;
|
||||
@@ -60,14 +34,6 @@ int main(int argc, char** argv) {
|
||||
verbose = argc > 2;
|
||||
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) {
|
||||
printf("calling sigaction\n");
|
||||
}
|
||||
|
||||
@@ -68,24 +68,6 @@ int main(int argc, char** argv) {
|
||||
|
||||
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:
|
||||
printf("Unknown test: %d\n", test);
|
||||
return 0;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -4,30 +4,6 @@
|
||||
|
||||
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 (
|
||||
@@ -70,11 +46,5 @@ func TestSEGV() {
|
||||
func Noop() {
|
||||
}
|
||||
|
||||
// Raise SIGPIPE.
|
||||
//export GoRaiseSIGPIPE
|
||||
func GoRaiseSIGPIPE() {
|
||||
C.CRaiseSIGPIPE()
|
||||
}
|
||||
|
||||
func main() {
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
// int8_t DidInitRun();
|
||||
// int8_t DidMainRun();
|
||||
// int32_t FromPkg();
|
||||
// uint32_t Divu(uint32_t, uint32_t);
|
||||
int main(void) {
|
||||
int8_t ran_init = DidInitRun();
|
||||
if (!ran_init) {
|
||||
@@ -31,11 +30,6 @@ int main(void) {
|
||||
fprintf(stderr, "ERROR: FromPkg=%d, want %d\n", from_pkg, 1024);
|
||||
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.
|
||||
printf("PASS\n");
|
||||
return 0;
|
||||
|
||||
@@ -8,5 +8,3 @@ import "C"
|
||||
|
||||
//export FromPkg
|
||||
func FromPkg() int32 { return 1024 }
|
||||
//export Divu
|
||||
func Divu(a, b uint32) uint32 { return a / b }
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
# Directory where cgo headers and outputs will be installed.
|
||||
# The installation directory format varies depending on the platform.
|
||||
installdir=pkg/${goos}_${goarch}_testcshared_shared
|
||||
if [ "${goos}" = "darwin" ]; then
|
||||
if [ "${goos}" == "darwin" ]; then
|
||||
installdir=pkg/${goos}_${goarch}_testcshared
|
||||
fi
|
||||
|
||||
@@ -40,13 +40,13 @@ function cleanup() {
|
||||
rm -f testp testp2 testp3 testp4 testp5
|
||||
rm -rf pkg "${goroot}/${installdir}"
|
||||
|
||||
if [ "$goos" = "android" ]; then
|
||||
if [ "$goos" == "android" ]; then
|
||||
adb shell rm -rf "$androidpath"
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
if [ "$goos" = "android" ]; then
|
||||
if [ "$goos" == "android" ]; then
|
||||
adb shell mkdir -p "$androidpath"
|
||||
fi
|
||||
|
||||
@@ -69,7 +69,7 @@ function run() {
|
||||
|
||||
function binpush() {
|
||||
bin=${1}
|
||||
if [ "$goos" = "android" ]; then
|
||||
if [ "$goos" == "android" ]; then
|
||||
adb push "$bin" "${androidpath}/${bin}" 2>/dev/null
|
||||
fi
|
||||
}
|
||||
@@ -79,7 +79,7 @@ rm -rf pkg
|
||||
suffix="-installsuffix testcshared"
|
||||
|
||||
libext="so"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
if [ "$goos" == "darwin" ]; then
|
||||
libext="dylib"
|
||||
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
|
||||
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
|
||||
echo "libgo.$libext has TEXTREL set"
|
||||
exit 1
|
||||
@@ -97,8 +97,8 @@ if [ "$goos" = "linux" ] || [ "$goos" = "android" ] ; then
|
||||
fi
|
||||
|
||||
GOGCCFLAGS=$(go env GOGCCFLAGS)
|
||||
if [ "$goos" = "android" ]; then
|
||||
GOGCCFLAGS="${GOGCCFLAGS} -pie -fuse-ld=gold"
|
||||
if [ "$goos" == "android" ]; then
|
||||
GOGCCFLAGS="${GOGCCFLAGS} -pie"
|
||||
fi
|
||||
|
||||
status=0
|
||||
@@ -127,7 +127,7 @@ fi
|
||||
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo2.$libext libgo2
|
||||
binpush libgo2.$libext
|
||||
linkflags="-Wl,--no-as-needed"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
if [ "$goos" == "darwin" ]; then
|
||||
linkflags=""
|
||||
fi
|
||||
$(go env CC) ${GOGCCFLAGS} -o testp2 main2.c $linkflags libgo2.$libext
|
||||
@@ -139,7 +139,7 @@ if [ "$output" != "PASS" ]; then
|
||||
fi
|
||||
|
||||
# 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
|
||||
binpush testp3
|
||||
output=$(run ./testp ./libgo.so)
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -16,7 +16,7 @@ goarch=$(go env GOARCH)
|
||||
|
||||
function cleanup() {
|
||||
rm -f plugin*.so unnamed*.so iface*.so
|
||||
rm -rf host pkg sub iface issue18676 issue19534
|
||||
rm -rf host pkg sub iface issue18676
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
@@ -44,9 +44,3 @@ LD_LIBRARY_PATH=$(pwd) ./iface
|
||||
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
|
||||
|
||||
@@ -9,15 +9,4 @@ import "C"
|
||||
|
||||
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() {}
|
||||
|
||||
@@ -9,13 +9,4 @@ import "C"
|
||||
|
||||
func FuncInt() int { return 2 }
|
||||
|
||||
func FuncRecursive() X { return X{} }
|
||||
|
||||
type Y struct {
|
||||
X *X
|
||||
}
|
||||
type X struct {
|
||||
Y Y
|
||||
}
|
||||
|
||||
func main() {}
|
||||
|
||||
@@ -72,12 +72,12 @@ testmsanshared() {
|
||||
goos=$(go env GOOS)
|
||||
suffix="-installsuffix testsanitizers"
|
||||
libext="so"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
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
|
||||
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
|
||||
@@ -131,43 +131,21 @@ if test "$msan" = "yes"; then
|
||||
testmsanshared
|
||||
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
|
||||
echo 'int main() { return 0; }' > ${TMPDIR}/testsanitizers$$.c
|
||||
ok=yes
|
||||
if ! $CC -fsanitize=thread ${TMPDIR}/testsanitizers$$.c -o ${TMPDIR}/testsanitizers$$ &> ${TMPDIR}/testsanitizers$$.err; then
|
||||
ok=no
|
||||
fi
|
||||
if grep "unrecognized" ${TMPDIR}/testsanitizers$$.err >& /dev/null; then
|
||||
if grep "unrecognized" ${TMPDIR}/testsanitizers$$.err >& /dev/null; then
|
||||
echo "skipping tsan tests: -fsanitize=thread not supported"
|
||||
tsan=no
|
||||
elif test "$ok" != "yes"; then
|
||||
cat ${TMPDIR}/testsanitizers$$.err
|
||||
echo "skipping tsan tests: -fsanitizer=thread build failed"
|
||||
tsan=no
|
||||
elif ! ${TMPDIR}/testsanitizers$$ 2>&1; then
|
||||
echo "skipping tsan tests: running tsan program failed"
|
||||
tsan=no
|
||||
fi
|
||||
rm -f ${TMPDIR}/testsanitizers$$*
|
||||
elif test "$ok" != "yes"; then
|
||||
cat ${TMPDIR}/testsanitizers$$.err
|
||||
echo "skipping tsan tests: -fsanitizer=thread build failed"
|
||||
tsan=no
|
||||
fi
|
||||
rm -f ${TMPDIR}/testsanitizers$$*
|
||||
fi
|
||||
|
||||
# Run a TSAN test.
|
||||
@@ -199,10 +177,8 @@ if test "$tsan" = "yes"; then
|
||||
# These tests are only reliable using clang or GCC version 7 or later.
|
||||
# Otherwise runtime/cgo/libcgo.h can't tell whether TSAN is in use.
|
||||
ok=false
|
||||
clang=false
|
||||
if ${CC} --version | grep clang >/dev/null 2>&1; then
|
||||
ok=true
|
||||
clang=true
|
||||
else
|
||||
ver=$($CC -dumpversion)
|
||||
major=$(echo $ver | sed -e 's/\([0-9]*\).*/\1/')
|
||||
@@ -214,19 +190,14 @@ if test "$tsan" = "yes"; then
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
# 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"
|
||||
|
||||
# The remaining tests reportedly hang when built with GCC; issue #21196.
|
||||
if test "$clang" = "true"; then
|
||||
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"
|
||||
fi
|
||||
|
||||
testtsanshared
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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() {}
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"debug/elf"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
@@ -165,6 +166,7 @@ func TestMain(m *testing.M) {
|
||||
// That won't work if GOBIN is set.
|
||||
os.Unsetenv("GOBIN")
|
||||
|
||||
flag.Parse()
|
||||
exitCode, err := testMain(m)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -400,12 +402,6 @@ func TestTrivialExecutablePIE(t *testing.T) {
|
||||
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
|
||||
// runs.
|
||||
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) {
|
||||
goCmd(t, "install", "-buildmode=shared", "-linkshared", "depBase")
|
||||
goCmd(t, "install", "-linkshared", "exe")
|
||||
@@ -808,10 +797,9 @@ func TestABIChecking(t *testing.T) {
|
||||
run(t, "rebuilt exe", "./bin/exe")
|
||||
|
||||
// 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
|
||||
// is in a file by itself.
|
||||
// function) and rebuild libdepBase.so, exe still works.
|
||||
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")
|
||||
run(t, "after non-ABI breaking change", "./bin/exe")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -23,37 +23,28 @@ import (
|
||||
|
||||
func main() {
|
||||
devID := detectDevID()
|
||||
fmt.Printf("export GOIOS_DEV_ID=%s\n", devID)
|
||||
|
||||
udid := detectUDID()
|
||||
mps := detectMobileProvisionFiles(udid)
|
||||
if len(mps) == 0 {
|
||||
fail("did not find mobile provision matching device udid %s", udid)
|
||||
}
|
||||
mp := detectMobileProvisionFile(udid)
|
||||
|
||||
fmt.Println("Available provisioning profiles below.")
|
||||
fmt.Println("NOTE: Any existing app on the device with the app id specified by GOIOS_APP_ID")
|
||||
fmt.Println("will be overwritten when running Go programs.")
|
||||
for _, mp := range mps {
|
||||
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)
|
||||
f, err := ioutil.TempFile("", "go_ios_detect_")
|
||||
check(err)
|
||||
fname := f.Name()
|
||||
defer os.Remove(fname)
|
||||
|
||||
out := output(parseMobileProvision(mp))
|
||||
_, err = f.Write(out)
|
||||
check(err)
|
||||
check(f.Close())
|
||||
out := combinedOutput(parseMobileProvision(mp))
|
||||
_, err = f.Write(out)
|
||||
check(err)
|
||||
check(f.Close())
|
||||
|
||||
appID, err := plistExtract(fname, "Entitlements:application-identifier")
|
||||
check(err)
|
||||
fmt.Printf("export GOIOS_APP_ID=%s\n", appID)
|
||||
appID, err := plistExtract(fname, "ApplicationIdentifierPrefix:0")
|
||||
check(err)
|
||||
fmt.Printf("export GOIOS_APP_ID=%s\n", appID)
|
||||
|
||||
teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier")
|
||||
check(err)
|
||||
fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID)
|
||||
}
|
||||
teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier")
|
||||
check(err)
|
||||
fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID)
|
||||
}
|
||||
|
||||
func detectDevID() string {
|
||||
@@ -88,11 +79,10 @@ func detectUDID() []byte {
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
func detectMobileProvisionFiles(udid []byte) []string {
|
||||
func detectMobileProvisionFile(udid []byte) string {
|
||||
cmd := exec.Command("mdfind", "-name", ".mobileprovision")
|
||||
lines := getLines(cmd)
|
||||
|
||||
var files []string
|
||||
for _, line := range lines {
|
||||
if len(line) == 0 {
|
||||
continue
|
||||
@@ -100,11 +90,12 @@ func detectMobileProvisionFiles(udid []byte) []string {
|
||||
xmlLines := getLines(parseMobileProvision(string(line)))
|
||||
for _, xmlLine := range xmlLines {
|
||||
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 {
|
||||
@@ -120,12 +111,12 @@ func plistExtract(fname string, path string) ([]byte, error) {
|
||||
}
|
||||
|
||||
func getLines(cmd *exec.Cmd) [][]byte {
|
||||
out := output(cmd)
|
||||
out := combinedOutput(cmd)
|
||||
return bytes.Split(out, []byte("\n"))
|
||||
}
|
||||
|
||||
func output(cmd *exec.Cmd) []byte {
|
||||
out, err := cmd.Output()
|
||||
func combinedOutput(cmd *exec.Cmd) []byte {
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
fmt.Println(strings.Join(cmd.Args, "\n"))
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
|
||||
@@ -45,10 +45,9 @@ var errRetry = errors.New("failed to start test harness (retry attempted)")
|
||||
var tmpdir string
|
||||
|
||||
var (
|
||||
devID string
|
||||
appID string
|
||||
teamID string
|
||||
bundleID string
|
||||
devID string
|
||||
appID string
|
||||
teamID string
|
||||
)
|
||||
|
||||
// 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.
|
||||
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
|
||||
tmpdir, err = ioutil.TempDir("", "go_darwin_arm_exec_")
|
||||
if err != nil {
|
||||
@@ -107,7 +99,7 @@ func main() {
|
||||
// Approximately 1 in a 100 binaries fail to start. If it happens,
|
||||
// try again. These failures happen for several reasons beyond
|
||||
// our control, but all of them are safe to retry as they happen
|
||||
// before lldb encounters the initial getwd breakpoint. As we
|
||||
// before lldb encounters the initial SIGUSR2 stop. As we
|
||||
// know the tests haven't started, we are not hiding flaky tests
|
||||
// with this retry.
|
||||
for i := 0; i < 5; i++ {
|
||||
@@ -147,22 +139,22 @@ func run(bin string, args []string) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
pkgpath, err := copyLocalData(appdir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist")
|
||||
if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
|
||||
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
|
||||
}
|
||||
if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pkgpath, err := copyLocalData(appdir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd := exec.Command(
|
||||
"codesign",
|
||||
"-f",
|
||||
@@ -212,6 +204,11 @@ func run(bin string, args []string) (err error) {
|
||||
var opts options
|
||||
opts, args = parseArgs(args)
|
||||
|
||||
// Pass the suffix for the current working directory as the
|
||||
// first argument to the test. For iOS, cmd/go generates
|
||||
// special handling of this argument.
|
||||
args = append([]string{"cwdSuffix=" + pkgpath}, args...)
|
||||
|
||||
// ios-deploy invokes lldb to give us a shell session with the app.
|
||||
s, err := newSession(appdir, args, opts)
|
||||
if err != nil {
|
||||
@@ -232,6 +229,7 @@ func run(bin string, args []string) (err error) {
|
||||
s.do(`process handle SIGHUP --stop false --pass true --notify false`)
|
||||
s.do(`process handle SIGPIPE --stop false --pass true --notify false`)
|
||||
s.do(`process handle SIGUSR1 --stop false --pass true --notify false`)
|
||||
s.do(`process handle SIGUSR2 --stop true --pass false --notify true`) // sent by test harness
|
||||
s.do(`process handle SIGCONT --stop false --pass true --notify false`)
|
||||
s.do(`process handle SIGSEGV --stop false --pass true --notify false`) // does not work
|
||||
s.do(`process handle SIGBUS --stop false --pass true --notify false`) // does not work
|
||||
@@ -246,7 +244,7 @@ func run(bin string, args []string) (err error) {
|
||||
|
||||
started = true
|
||||
|
||||
s.doCmd("run", "stop reason = signal SIGINT", 20*time.Second)
|
||||
s.doCmd("run", "stop reason = signal SIGUSR2", 20*time.Second)
|
||||
|
||||
startTestsLen := s.out.Len()
|
||||
fmt.Fprintln(s.in, `process continue`)
|
||||
@@ -256,9 +254,7 @@ func run(bin string, args []string) (err error) {
|
||||
return s.out.LastIndex([]byte("\nPASS\n")) > startTestsLen ||
|
||||
s.out.LastIndex([]byte("\nPASS\r")) > startTestsLen ||
|
||||
s.out.LastIndex([]byte("\n(lldb) PASS\n")) > 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
|
||||
s.out.LastIndex([]byte("\n(lldb) PASS\r")) > startTestsLen
|
||||
}
|
||||
err = s.wait("test completion", passed, opts.timeout)
|
||||
if passed(s.out) {
|
||||
@@ -346,7 +342,7 @@ func newSession(appdir string, args []string, opts options) (*lldbSession, error
|
||||
i2 := s.out.LastIndex([]byte(" connect"))
|
||||
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})
|
||||
}
|
||||
return s, nil
|
||||
@@ -444,7 +440,7 @@ func parseArgs(binArgs []string) (opts options, remainingArgs []string) {
|
||||
remainingArgs = append(remainingArgs, arg)
|
||||
}
|
||||
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.Parse(flagArgs)
|
||||
return opts, remainingArgs
|
||||
@@ -517,33 +513,18 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Copy timezone file.
|
||||
//
|
||||
// Apps have the zoneinfo.zip in the root of their app bundle,
|
||||
// read by the time package as the working directory at initialization.
|
||||
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(
|
||||
filepath.Join(dstbase, pkgpath),
|
||||
dstbase,
|
||||
filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
|
||||
)
|
||||
if err != nil {
|
||||
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
|
||||
@@ -581,8 +562,7 @@ func subdir() (pkgpath string, underGoRoot bool, err error) {
|
||||
)
|
||||
}
|
||||
|
||||
func infoPlist(pkgpath string) string {
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||
const infoPlist = `<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
@@ -590,15 +570,13 @@ func infoPlist(pkgpath string) string {
|
||||
<key>CFBundleSupportedPlatforms</key><array><string>iPhoneOS</string></array>
|
||||
<key>CFBundleExecutable</key><string>gotest</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>LSRequiresIPhoneOS</key><true/>
|
||||
<key>CFBundleDisplayName</key><string>gotest</string>
|
||||
<key>GoExecWrapperWorkingDirectory</key><string>` + pkgpath + `</string>
|
||||
</dict>
|
||||
</plist>
|
||||
`
|
||||
}
|
||||
|
||||
func entitlementsPlist() string {
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||
@@ -606,11 +584,11 @@ func entitlementsPlist() string {
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>keychain-access-groups</key>
|
||||
<array><string>` + appID + `</string></array>
|
||||
<array><string>` + appID + `.golang.gotest</string></array>
|
||||
<key>get-task-allow</key>
|
||||
<true/>
|
||||
<key>application-identifier</key>
|
||||
<string>` + appID + `</string>
|
||||
<string>` + appID + `.golang.gotest</string>
|
||||
<key>com.apple.developer.team-identifier</key>
|
||||
<string>` + teamID + `</string>
|
||||
</dict>
|
||||
|
||||
@@ -37,26 +37,6 @@ go src=..
|
||||
testdata
|
||||
+
|
||||
vendor
|
||||
github.com
|
||||
google
|
||||
pprof
|
||||
internal
|
||||
driver
|
||||
testdata
|
||||
+
|
||||
graph
|
||||
testdata
|
||||
+
|
||||
report
|
||||
testdata
|
||||
+
|
||||
profile
|
||||
testdata
|
||||
+
|
||||
ianlancetaylor
|
||||
demangle
|
||||
testdata
|
||||
+
|
||||
golang.org
|
||||
x
|
||||
arch
|
||||
@@ -162,8 +142,6 @@ go src=..
|
||||
regexp
|
||||
testdata
|
||||
+
|
||||
runtime
|
||||
textflag.h
|
||||
strconv
|
||||
testdata
|
||||
+
|
||||
|
||||
@@ -158,15 +158,11 @@ func (fi headerFileInfo) Mode() (mode os.FileMode) {
|
||||
// sysStat, if non-nil, populates h from system-dependent fields of fi.
|
||||
var sysStat func(fi os.FileInfo, h *Header) error
|
||||
|
||||
// Mode constants from the tar spec.
|
||||
const (
|
||||
// Mode constants from the USTAR spec:
|
||||
// See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06
|
||||
c_ISUID = 04000 // Set uid
|
||||
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_ISUID = 04000 // Set uid
|
||||
c_ISGID = 02000 // Set gid
|
||||
c_ISVTX = 01000 // Save text (sticky bit)
|
||||
c_ISDIR = 040000 // Directory
|
||||
c_ISFIFO = 010000 // FIFO
|
||||
c_ISREG = 0100000 // Regular file
|
||||
@@ -212,24 +208,30 @@ func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) {
|
||||
}
|
||||
switch {
|
||||
case fm.IsRegular():
|
||||
h.Mode |= c_ISREG
|
||||
h.Typeflag = TypeReg
|
||||
h.Size = fi.Size()
|
||||
case fi.IsDir():
|
||||
h.Typeflag = TypeDir
|
||||
h.Mode |= c_ISDIR
|
||||
h.Name += "/"
|
||||
case fm&os.ModeSymlink != 0:
|
||||
h.Typeflag = TypeSymlink
|
||||
h.Mode |= c_ISLNK
|
||||
h.Linkname = link
|
||||
case fm&os.ModeDevice != 0:
|
||||
if fm&os.ModeCharDevice != 0 {
|
||||
h.Mode |= c_ISCHR
|
||||
h.Typeflag = TypeChar
|
||||
} else {
|
||||
h.Mode |= c_ISBLK
|
||||
h.Typeflag = TypeBlock
|
||||
}
|
||||
case fm&os.ModeNamedPipe != 0:
|
||||
h.Typeflag = TypeFifo
|
||||
h.Mode |= c_ISFIFO
|
||||
case fm&os.ModeSocket != 0:
|
||||
return nil, fmt.Errorf("archive/tar: sockets not supported")
|
||||
h.Mode |= c_ISSOCK
|
||||
default:
|
||||
return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm)
|
||||
}
|
||||
|
||||
@@ -6,11 +6,9 @@ package tar
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"internal/testenv"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -29,7 +27,7 @@ func TestFileInfoHeader(t *testing.T) {
|
||||
if g, e := h.Name, "small.txt"; 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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
// 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)
|
||||
}
|
||||
if g, e := h.Size, int64(0); g != e {
|
||||
@@ -69,56 +67,40 @@ func TestFileInfoHeaderDir(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFileInfoHeaderSymlink(t *testing.T) {
|
||||
testenv.MustHaveSymlink(t)
|
||||
|
||||
tmpdir, err := ioutil.TempDir("", "TestFileInfoHeaderSymlink")
|
||||
h, err := FileInfoHeader(symlink{}, "some-target")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmpdir)
|
||||
|
||||
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 {
|
||||
if g, e := h.Name, "some-symlink"; 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)
|
||||
}
|
||||
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) {
|
||||
data := []byte("some file contents")
|
||||
|
||||
var b bytes.Buffer
|
||||
tw := NewWriter(&b)
|
||||
hdr := &Header{
|
||||
Name: "file.txt",
|
||||
Uid: 1 << 21, // too big for 8 octal digits
|
||||
Size: int64(len(data)),
|
||||
// AddDate to strip monotonic clock reading,
|
||||
// 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),
|
||||
Name: "file.txt",
|
||||
Uid: 1 << 21, // too big for 8 octal digits
|
||||
Size: int64(len(data)),
|
||||
ModTime: time.Now(),
|
||||
}
|
||||
// tar only supports second precision.
|
||||
hdr.ModTime = hdr.ModTime.Add(-time.Duration(hdr.ModTime.Nanosecond()) * time.Nanosecond)
|
||||
if err := tw.WriteHeader(hdr); err != nil {
|
||||
t.Fatalf("tw.WriteHeader: %v", err)
|
||||
}
|
||||
@@ -157,7 +139,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// regular file.
|
||||
h: &Header{
|
||||
Name: "test.txt",
|
||||
Mode: 0644,
|
||||
Mode: 0644 | c_ISREG,
|
||||
Size: 12,
|
||||
ModTime: time.Unix(1360600916, 0),
|
||||
Typeflag: TypeReg,
|
||||
@@ -167,7 +149,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// symbolic link.
|
||||
h: &Header{
|
||||
Name: "link.txt",
|
||||
Mode: 0777,
|
||||
Mode: 0777 | c_ISLNK,
|
||||
Size: 0,
|
||||
ModTime: time.Unix(1360600852, 0),
|
||||
Typeflag: TypeSymlink,
|
||||
@@ -177,7 +159,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// character device node.
|
||||
h: &Header{
|
||||
Name: "dev/null",
|
||||
Mode: 0666,
|
||||
Mode: 0666 | c_ISCHR,
|
||||
Size: 0,
|
||||
ModTime: time.Unix(1360578951, 0),
|
||||
Typeflag: TypeChar,
|
||||
@@ -187,7 +169,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// block device node.
|
||||
h: &Header{
|
||||
Name: "dev/sda",
|
||||
Mode: 0660,
|
||||
Mode: 0660 | c_ISBLK,
|
||||
Size: 0,
|
||||
ModTime: time.Unix(1360578954, 0),
|
||||
Typeflag: TypeBlock,
|
||||
@@ -197,7 +179,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// directory.
|
||||
h: &Header{
|
||||
Name: "dir/",
|
||||
Mode: 0755,
|
||||
Mode: 0755 | c_ISDIR,
|
||||
Size: 0,
|
||||
ModTime: time.Unix(1360601116, 0),
|
||||
Typeflag: TypeDir,
|
||||
@@ -207,7 +189,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// fifo node.
|
||||
h: &Header{
|
||||
Name: "dev/initctl",
|
||||
Mode: 0600,
|
||||
Mode: 0600 | c_ISFIFO,
|
||||
Size: 0,
|
||||
ModTime: time.Unix(1360578949, 0),
|
||||
Typeflag: TypeFifo,
|
||||
@@ -217,7 +199,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// setuid.
|
||||
h: &Header{
|
||||
Name: "bin/su",
|
||||
Mode: 0755 | c_ISUID,
|
||||
Mode: 0755 | c_ISREG | c_ISUID,
|
||||
Size: 23232,
|
||||
ModTime: time.Unix(1355405093, 0),
|
||||
Typeflag: TypeReg,
|
||||
@@ -227,7 +209,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// setguid.
|
||||
h: &Header{
|
||||
Name: "group.txt",
|
||||
Mode: 0750 | c_ISGID,
|
||||
Mode: 0750 | c_ISREG | c_ISGID,
|
||||
Size: 0,
|
||||
ModTime: time.Unix(1360602346, 0),
|
||||
Typeflag: TypeReg,
|
||||
@@ -237,7 +219,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// sticky.
|
||||
h: &Header{
|
||||
Name: "sticky.txt",
|
||||
Mode: 0600 | c_ISVTX,
|
||||
Mode: 0600 | c_ISREG | c_ISVTX,
|
||||
Size: 7,
|
||||
ModTime: time.Unix(1360602540, 0),
|
||||
Typeflag: TypeReg,
|
||||
@@ -247,7 +229,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// hard link.
|
||||
h: &Header{
|
||||
Name: "hard.txt",
|
||||
Mode: 0644,
|
||||
Mode: 0644 | c_ISREG,
|
||||
Size: 0,
|
||||
Linkname: "file.txt",
|
||||
ModTime: time.Unix(1360600916, 0),
|
||||
@@ -258,7 +240,7 @@ func TestHeaderRoundTrip(t *testing.T) {
|
||||
// More information.
|
||||
h: &Header{
|
||||
Name: "info.txt",
|
||||
Mode: 0600,
|
||||
Mode: 0600 | c_ISREG,
|
||||
Size: 0,
|
||||
Uid: 1000,
|
||||
Gid: 1000,
|
||||
|
||||
BIN
src/archive/tar/testdata/ustar.issue12594.tar
vendored
BIN
src/archive/tar/testdata/ustar.issue12594.tar
vendored
Binary file not shown.
BIN
src/archive/tar/testdata/writer-big-long.tar
vendored
BIN
src/archive/tar/testdata/writer-big-long.tar
vendored
Binary file not shown.
@@ -121,15 +121,9 @@ func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
|
||||
needsPaxHeader := paxKeyword != paxNone && len(s) > len(b) || !isASCII(s)
|
||||
if needsPaxHeader {
|
||||
paxHeaders[paxKeyword] = s
|
||||
return
|
||||
}
|
||||
|
||||
// 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
|
||||
f.formatString(b, s)
|
||||
}
|
||||
var formatNumeric = func(b []byte, x int64, paxKeyword string) {
|
||||
// Try octal first.
|
||||
|
||||
@@ -103,46 +103,51 @@ func (r *pooledFlateReader) Close() error {
|
||||
}
|
||||
|
||||
var (
|
||||
compressors sync.Map // map[uint16]Compressor
|
||||
decompressors sync.Map // map[uint16]Decompressor
|
||||
mu sync.RWMutex // guards compressor and decompressor maps
|
||||
|
||||
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.
|
||||
// The common methods Store and Deflate are built in.
|
||||
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")
|
||||
}
|
||||
decompressors[method] = dcomp
|
||||
}
|
||||
|
||||
// RegisterCompressor registers custom compressors for a specified method ID.
|
||||
// The common methods Store and Deflate are built in.
|
||||
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")
|
||||
}
|
||||
compressors[method] = comp
|
||||
}
|
||||
|
||||
func compressor(method uint16) Compressor {
|
||||
ci, ok := compressors.Load(method)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return ci.(Compressor)
|
||||
mu.RLock()
|
||||
defer mu.RUnlock()
|
||||
return compressors[method]
|
||||
}
|
||||
|
||||
func decompressor(method uint16) Decompressor {
|
||||
di, ok := decompressors.Load(method)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return di.(Decompressor)
|
||||
mu.RLock()
|
||||
defer mu.RUnlock()
|
||||
return decompressors[method]
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
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.
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ import (
|
||||
"hash"
|
||||
"hash/crc32"
|
||||
"io"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
// TODO(adg): support zip file comments
|
||||
|
||||
// Writer implements a zip file writer.
|
||||
type Writer struct {
|
||||
cw *countWriter
|
||||
@@ -200,20 +201,6 @@ func (w *Writer) Create(name string) (io.Writer, error) {
|
||||
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
|
||||
// for the file metadata.
|
||||
// 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
|
||||
|
||||
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.ReaderVersion = zipVersion20
|
||||
|
||||
|
||||
@@ -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) {
|
||||
largeData := make([]byte, 1<<17)
|
||||
for i := range largeData {
|
||||
@@ -244,11 +181,12 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
|
||||
}
|
||||
|
||||
func BenchmarkCompressedZipGarbage(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
var buf bytes.Buffer
|
||||
bigBuf := bytes.Repeat([]byte("a"), 1<<20)
|
||||
|
||||
runOnce := func(buf *bytes.Buffer) {
|
||||
for i := 0; i <= b.N; i++ {
|
||||
buf.Reset()
|
||||
zw := NewWriter(buf)
|
||||
zw := NewWriter(&buf)
|
||||
for j := 0; j < 3; j++ {
|
||||
w, _ := zw.CreateHeader(&FileHeader{
|
||||
Name: "foo",
|
||||
@@ -257,19 +195,11 @@ func BenchmarkCompressedZipGarbage(b *testing.B) {
|
||||
w.Write(bigBuf)
|
||||
}
|
||||
zw.Close()
|
||||
}
|
||||
|
||||
b.ReportAllocs()
|
||||
// Run once and then reset the timer.
|
||||
// This effectively discards the very large initial flate setup cost,
|
||||
// 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)
|
||||
if i == 0 {
|
||||
// Reset the timer after the first time through.
|
||||
// This effectively discards the very large initial flate setup cost,
|
||||
// as well as the initialization of bigBuf.
|
||||
b.ResetTimer()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ func TestZip64EdgeCase(t *testing.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.
|
||||
func TestZip64DirectoryOffset(t *testing.T) {
|
||||
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) {
|
||||
const keep = 10
|
||||
ss := &suffixSaver{keep: keep}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// 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
|
||||
// the interface but provides buffering and some help for textual I/O.
|
||||
package bufio
|
||||
@@ -458,7 +458,6 @@ func (b *Reader) ReadString(delim byte) (string, error) {
|
||||
}
|
||||
|
||||
// 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) {
|
||||
n, err = b.writeBuf(w)
|
||||
if err != nil {
|
||||
@@ -514,7 +513,7 @@ func (b *Reader) writeBuf(w io.Writer) (int64, error) {
|
||||
|
||||
// Writer implements buffering for an io.Writer object.
|
||||
// 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
|
||||
// Flush method to guarantee all data has been forwarded to
|
||||
// the underlying io.Writer.
|
||||
|
||||
@@ -169,6 +169,7 @@ func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) {
|
||||
}
|
||||
buf.WriteByte('\n')
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Test the line splitter, including some carriage returns but no long lines.
|
||||
|
||||
@@ -19,70 +19,52 @@ fi
|
||||
|
||||
sete=false
|
||||
if [ "$1" = "-e" ]; then
|
||||
sete=true
|
||||
shift
|
||||
sete=true
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$sete" = true ]; then
|
||||
set -e
|
||||
set -e
|
||||
fi
|
||||
|
||||
pattern="$1"
|
||||
if [ "$pattern" = "" ]; then
|
||||
pattern=.
|
||||
pattern=.
|
||||
fi
|
||||
|
||||
./make.bash || exit 1
|
||||
GOROOT="$(cd .. && pwd)"
|
||||
|
||||
gettargets() {
|
||||
../bin/go tool dist list | sed -e 's|/|-|'
|
||||
echo linux-386-387
|
||||
echo linux-arm-arm5
|
||||
}
|
||||
|
||||
selectedtargets() {
|
||||
gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
|
||||
}
|
||||
|
||||
# put linux, nacl first in the target list to get all the architectures up front.
|
||||
linux_nacl_targets() {
|
||||
selectedtargets | egrep 'linux|nacl' | sort
|
||||
}
|
||||
|
||||
non_linux_nacl_targets() {
|
||||
selectedtargets | egrep -v 'linux|nacl' | sort
|
||||
}
|
||||
|
||||
# Note words in $targets are separated by both newlines and spaces.
|
||||
targets="$(linux_nacl_targets) $(non_linux_nacl_targets)"
|
||||
targets="$((../bin/go tool dist list | sed -n 's/^\(.*\)\/\(.*\)/\1-\2/p'; echo linux-386-387 linux-arm-arm5) | sort | egrep -v android-arm | egrep "$pattern" | egrep 'linux|nacl')
|
||||
$(../bin/go tool dist list | sed -n 's/^\(.*\)\/\(.*\)/\1-\2/p' | egrep -v 'android-arm|darwin-arm' | egrep "$pattern" | egrep -v 'linux|nacl')"
|
||||
|
||||
failed=false
|
||||
for target in $targets
|
||||
do
|
||||
echo ""
|
||||
echo "### Building $target"
|
||||
export GOOS=$(echo $target | sed 's/-.*//')
|
||||
export GOARCH=$(echo $target | sed 's/.*-//')
|
||||
unset GO386 GOARM
|
||||
if [ "$GOARCH" = "arm5" ]; then
|
||||
export GOARCH=arm
|
||||
export GOARM=5
|
||||
fi
|
||||
if [ "$GOARCH" = "387" ]; then
|
||||
export GOARCH=386
|
||||
export GO386=387
|
||||
fi
|
||||
if ! "$GOROOT/bin/go" build -a std cmd; then
|
||||
failed=true
|
||||
if $sete; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
echo "### Building $target"
|
||||
export GOOS=$(echo $target | sed 's/-.*//')
|
||||
export GOARCH=$(echo $target | sed 's/.*-//')
|
||||
unset GO386 GOARM
|
||||
if [ "$GOARCH" = "arm5" ]; then
|
||||
export GOARCH=arm
|
||||
export GOARM=5
|
||||
fi
|
||||
if [ "$GOARCH" = "387" ]; then
|
||||
export GOARCH=386
|
||||
export GO386=387
|
||||
fi
|
||||
if ! "$GOROOT/bin/go" build -a std cmd; then
|
||||
failed=true
|
||||
if $sete; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$failed" = "true" ]; then
|
||||
echo "" 1>&2
|
||||
echo "Build(s) failed." 1>&2
|
||||
exit 1
|
||||
echo "" 1>&2
|
||||
echo "Build(s) failed." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -85,11 +85,11 @@ type uintptr uintptr
|
||||
// byte is an alias for uint8 and is equivalent to uint8 in all ways. It is
|
||||
// used, by convention, to distinguish byte values from 8-bit unsigned
|
||||
// integer values.
|
||||
type byte = uint8
|
||||
type byte byte
|
||||
|
||||
// rune is an alias for int32 and is equivalent to int32 in all ways. It is
|
||||
// used, by convention, to distinguish character values from integer values.
|
||||
type rune = int32
|
||||
type rune rune
|
||||
|
||||
// iota is a predeclared identifier representing the untyped integer ordinal
|
||||
// number of the current const specification in a (usually parenthesized)
|
||||
@@ -179,7 +179,7 @@ func cap(v Type) int
|
||||
// Channel: The channel's buffer is initialized with the specified
|
||||
// buffer capacity. If zero, or the size is omitted, the channel is
|
||||
// unbuffered.
|
||||
func make(t Type, size ...IntegerType) Type
|
||||
func make(Type, size IntegerType) Type
|
||||
|
||||
// The new built-in function allocates memory. The first argument is a type,
|
||||
// not a value, and the value returned is a pointer to a newly
|
||||
|
||||
@@ -15,15 +15,10 @@ import (
|
||||
// A Buffer is a variable-sized buffer of bytes with Read and Write methods.
|
||||
// The zero value for Buffer is an empty buffer ready to use.
|
||||
type Buffer struct {
|
||||
buf []byte // contents are the bytes buf[off : len(buf)]
|
||||
off int // read at &buf[off], write at &buf[len(buf)]
|
||||
lastRead readOp // last read operation, so that Unread* can work correctly.
|
||||
// FIXME: lastRead can fit in a single byte
|
||||
|
||||
// memory to hold first slice; helps small buffers avoid allocation.
|
||||
// FIXME: it would be advisable to align Buffer to cachelines to avoid false
|
||||
// sharing.
|
||||
bootstrap [64]byte
|
||||
buf []byte // contents are the bytes buf[off : len(buf)]
|
||||
off int // read at &buf[off], write at &buf[len(buf)]
|
||||
bootstrap [64]byte // memory to hold first slice; helps small buffers avoid allocation.
|
||||
lastRead readOp // last read operation, so that Unread* can work correctly.
|
||||
}
|
||||
|
||||
// The readOp constants describe the last action performed on
|
||||
@@ -73,13 +68,13 @@ func (b *Buffer) Cap() int { return cap(b.buf) }
|
||||
// but continues to use the same allocated storage.
|
||||
// It panics if n is negative or greater than the length of the buffer.
|
||||
func (b *Buffer) Truncate(n int) {
|
||||
if n == 0 {
|
||||
b.Reset()
|
||||
return
|
||||
}
|
||||
b.lastRead = opInvalid
|
||||
if n < 0 || n > b.Len() {
|
||||
switch {
|
||||
case n < 0 || n > b.Len():
|
||||
panic("bytes.Buffer: truncation out of range")
|
||||
case n == 0:
|
||||
// Reuse buffer space.
|
||||
b.off = 0
|
||||
}
|
||||
b.buf = b.buf[0 : b.off+n]
|
||||
}
|
||||
@@ -87,22 +82,7 @@ func (b *Buffer) Truncate(n int) {
|
||||
// Reset resets the buffer to be empty,
|
||||
// but it retains the underlying storage for use by future writes.
|
||||
// Reset is the same as Truncate(0).
|
||||
func (b *Buffer) Reset() {
|
||||
b.buf = b.buf[:0]
|
||||
b.off = 0
|
||||
b.lastRead = opInvalid
|
||||
}
|
||||
|
||||
// tryGrowByReslice is a inlineable version of grow for the fast-case where the
|
||||
// internal buffer only needs to be resliced.
|
||||
// It returns the index where bytes should be written and whether it succeeded.
|
||||
func (b *Buffer) tryGrowByReslice(n int) (int, bool) {
|
||||
if l := len(b.buf); l+n <= cap(b.buf) {
|
||||
b.buf = b.buf[:l+n]
|
||||
return l, true
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
func (b *Buffer) Reset() { b.Truncate(0) }
|
||||
|
||||
// grow grows the buffer to guarantee space for n more bytes.
|
||||
// It returns the index where bytes should be written.
|
||||
@@ -111,33 +91,29 @@ func (b *Buffer) grow(n int) int {
|
||||
m := b.Len()
|
||||
// If buffer is empty, reset to recover space.
|
||||
if m == 0 && b.off != 0 {
|
||||
b.Reset()
|
||||
b.Truncate(0)
|
||||
}
|
||||
// Try to grow by means of a reslice.
|
||||
if i, ok := b.tryGrowByReslice(n); ok {
|
||||
return i
|
||||
}
|
||||
// Check if we can make use of bootstrap array.
|
||||
if b.buf == nil && n <= len(b.bootstrap) {
|
||||
b.buf = b.bootstrap[:n]
|
||||
return 0
|
||||
}
|
||||
if m+n <= cap(b.buf)/2 {
|
||||
// We can slide things down instead of allocating a new
|
||||
// slice. We only need m+n <= cap(b.buf) to slide, but
|
||||
// we instead let capacity get twice as large so we
|
||||
// don't spend all our time copying.
|
||||
copy(b.buf[:], b.buf[b.off:])
|
||||
} else {
|
||||
// Not enough space anywhere, we need to allocate.
|
||||
buf := makeSlice(2*cap(b.buf) + n)
|
||||
copy(buf, b.buf[b.off:])
|
||||
if len(b.buf)+n > cap(b.buf) {
|
||||
var buf []byte
|
||||
if b.buf == nil && n <= len(b.bootstrap) {
|
||||
buf = b.bootstrap[0:]
|
||||
} else if m+n <= cap(b.buf)/2 {
|
||||
// We can slide things down instead of allocating a new
|
||||
// slice. We only need m+n <= cap(b.buf) to slide, but
|
||||
// we instead let capacity get twice as large so we
|
||||
// don't spend all our time copying.
|
||||
copy(b.buf[:], b.buf[b.off:])
|
||||
buf = b.buf[:m]
|
||||
} else {
|
||||
// not enough space anywhere
|
||||
buf = makeSlice(2*cap(b.buf) + n)
|
||||
copy(buf, b.buf[b.off:])
|
||||
}
|
||||
b.buf = buf
|
||||
b.off = 0
|
||||
}
|
||||
// Restore b.off and len(b.buf).
|
||||
b.off = 0
|
||||
b.buf = b.buf[:m+n]
|
||||
return m
|
||||
b.buf = b.buf[0 : b.off+m+n]
|
||||
return b.off + m
|
||||
}
|
||||
|
||||
// Grow grows the buffer's capacity, if necessary, to guarantee space for
|
||||
@@ -158,10 +134,7 @@ func (b *Buffer) Grow(n int) {
|
||||
// buffer becomes too large, Write will panic with ErrTooLarge.
|
||||
func (b *Buffer) Write(p []byte) (n int, err error) {
|
||||
b.lastRead = opInvalid
|
||||
m, ok := b.tryGrowByReslice(len(p))
|
||||
if !ok {
|
||||
m = b.grow(len(p))
|
||||
}
|
||||
m := b.grow(len(p))
|
||||
return copy(b.buf[m:], p), nil
|
||||
}
|
||||
|
||||
@@ -170,10 +143,7 @@ func (b *Buffer) Write(p []byte) (n int, err error) {
|
||||
// buffer becomes too large, WriteString will panic with ErrTooLarge.
|
||||
func (b *Buffer) WriteString(s string) (n int, err error) {
|
||||
b.lastRead = opInvalid
|
||||
m, ok := b.tryGrowByReslice(len(s))
|
||||
if !ok {
|
||||
m = b.grow(len(s))
|
||||
}
|
||||
m := b.grow(len(s))
|
||||
return copy(b.buf[m:], s), nil
|
||||
}
|
||||
|
||||
@@ -191,7 +161,7 @@ func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
b.lastRead = opInvalid
|
||||
// If buffer is empty, reset to recover space.
|
||||
if b.off >= len(b.buf) {
|
||||
b.Reset()
|
||||
b.Truncate(0)
|
||||
}
|
||||
for {
|
||||
if free := cap(b.buf) - len(b.buf); free < MinRead {
|
||||
@@ -255,7 +225,7 @@ func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) {
|
||||
}
|
||||
}
|
||||
// Buffer is now empty; reset.
|
||||
b.Reset()
|
||||
b.Truncate(0)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -265,10 +235,7 @@ func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) {
|
||||
// ErrTooLarge.
|
||||
func (b *Buffer) WriteByte(c byte) error {
|
||||
b.lastRead = opInvalid
|
||||
m, ok := b.tryGrowByReslice(1)
|
||||
if !ok {
|
||||
m = b.grow(1)
|
||||
}
|
||||
m := b.grow(1)
|
||||
b.buf[m] = c
|
||||
return nil
|
||||
}
|
||||
@@ -283,10 +250,7 @@ func (b *Buffer) WriteRune(r rune) (n int, err error) {
|
||||
return 1, nil
|
||||
}
|
||||
b.lastRead = opInvalid
|
||||
m, ok := b.tryGrowByReslice(utf8.UTFMax)
|
||||
if !ok {
|
||||
m = b.grow(utf8.UTFMax)
|
||||
}
|
||||
m := b.grow(utf8.UTFMax)
|
||||
n = utf8.EncodeRune(b.buf[m:m+utf8.UTFMax], r)
|
||||
b.buf = b.buf[:m+n]
|
||||
return n, nil
|
||||
@@ -300,7 +264,7 @@ func (b *Buffer) Read(p []byte) (n int, err error) {
|
||||
b.lastRead = opInvalid
|
||||
if b.off >= len(b.buf) {
|
||||
// Buffer is empty, reset to recover space.
|
||||
b.Reset()
|
||||
b.Truncate(0)
|
||||
if len(p) == 0 {
|
||||
return
|
||||
}
|
||||
@@ -338,7 +302,7 @@ func (b *Buffer) ReadByte() (byte, error) {
|
||||
b.lastRead = opInvalid
|
||||
if b.off >= len(b.buf) {
|
||||
// Buffer is empty, reset to recover space.
|
||||
b.Reset()
|
||||
b.Truncate(0)
|
||||
return 0, io.EOF
|
||||
}
|
||||
c := b.buf[b.off]
|
||||
@@ -356,7 +320,7 @@ func (b *Buffer) ReadRune() (r rune, size int, err error) {
|
||||
b.lastRead = opInvalid
|
||||
if b.off >= len(b.buf) {
|
||||
// Buffer is empty, reset to recover space.
|
||||
b.Reset()
|
||||
b.Truncate(0)
|
||||
return 0, 0, io.EOF
|
||||
}
|
||||
c := b.buf[b.off]
|
||||
@@ -373,12 +337,12 @@ func (b *Buffer) ReadRune() (r rune, size int, err error) {
|
||||
|
||||
// UnreadRune unreads the last rune returned by ReadRune.
|
||||
// If the most recent read or write operation on the buffer was
|
||||
// not a successful ReadRune, UnreadRune returns an error. (In this regard
|
||||
// not a ReadRune, UnreadRune returns an error. (In this regard
|
||||
// it is stricter than UnreadByte, which will unread the last byte
|
||||
// from any read operation.)
|
||||
func (b *Buffer) UnreadRune() error {
|
||||
if b.lastRead <= opInvalid {
|
||||
return errors.New("bytes.Buffer: UnreadRune: previous operation was not a successful ReadRune")
|
||||
return errors.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune")
|
||||
}
|
||||
if b.off >= int(b.lastRead) {
|
||||
b.off -= int(b.lastRead)
|
||||
@@ -387,13 +351,12 @@ func (b *Buffer) UnreadRune() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UnreadByte unreads the last byte returned by the most recent successful
|
||||
// read operation that read at least one byte. If a write has happened since
|
||||
// the last read, if the last read returned an error, or if the read read zero
|
||||
// bytes, UnreadByte returns an error.
|
||||
// UnreadByte unreads the last byte returned by the most recent
|
||||
// read operation. If write has happened since the last read, UnreadByte
|
||||
// returns an error.
|
||||
func (b *Buffer) UnreadByte() error {
|
||||
if b.lastRead == opInvalid {
|
||||
return errors.New("bytes.Buffer: UnreadByte: previous operation was not a successful read")
|
||||
return errors.New("bytes.Buffer: UnreadByte: previous operation was not a read")
|
||||
}
|
||||
b.lastRead = opInvalid
|
||||
if b.off > 0 {
|
||||
@@ -441,12 +404,10 @@ func (b *Buffer) ReadString(delim byte) (line string, err error) {
|
||||
return string(slice), err
|
||||
}
|
||||
|
||||
// NewBuffer creates and initializes a new Buffer using buf as its
|
||||
// initial contents. The new Buffer takes ownership of buf, and the
|
||||
// caller should not use buf after this call. NewBuffer is intended to
|
||||
// prepare a Buffer to read existing data. It can also be used to size
|
||||
// the internal buffer for writing. To do that, buf should have the
|
||||
// desired capacity but a length of zero.
|
||||
// NewBuffer creates and initializes a new Buffer using buf as its initial
|
||||
// contents. It is intended to prepare a Buffer to read existing data. It
|
||||
// can also be used to size the internal buffer for writing. To do that,
|
||||
// buf should have the desired capacity but a length of zero.
|
||||
//
|
||||
// In most cases, new(Buffer) (or just declaring a Buffer variable) is
|
||||
// sufficient to initialize a Buffer.
|
||||
|
||||
@@ -6,10 +6,8 @@ package bytes_test
|
||||
|
||||
import (
|
||||
. "bytes"
|
||||
"internal/testenv"
|
||||
"io"
|
||||
"math/rand"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"testing"
|
||||
"unicode/utf8"
|
||||
@@ -313,19 +311,6 @@ func TestRuneIO(t *testing.T) {
|
||||
|
||||
// Check that UnreadRune works
|
||||
buf.Reset()
|
||||
|
||||
// check at EOF
|
||||
if err := buf.UnreadRune(); err == nil {
|
||||
t.Fatal("UnreadRune at EOF: got no error")
|
||||
}
|
||||
if _, _, err := buf.ReadRune(); err == nil {
|
||||
t.Fatal("ReadRune at EOF: got no error")
|
||||
}
|
||||
if err := buf.UnreadRune(); err == nil {
|
||||
t.Fatal("UnreadRune after ReadRune at EOF: got no error")
|
||||
}
|
||||
|
||||
// check not at EOF
|
||||
buf.Write(b)
|
||||
for r := rune(0); r < NRune; r++ {
|
||||
r1, size, _ := buf.ReadRune()
|
||||
@@ -488,34 +473,15 @@ func TestReadEmptyAtEOF(t *testing.T) {
|
||||
|
||||
func TestUnreadByte(t *testing.T) {
|
||||
b := new(Buffer)
|
||||
|
||||
// check at EOF
|
||||
if err := b.UnreadByte(); err == nil {
|
||||
t.Fatal("UnreadByte at EOF: got no error")
|
||||
}
|
||||
if _, err := b.ReadByte(); err == nil {
|
||||
t.Fatal("ReadByte at EOF: got no error")
|
||||
}
|
||||
if err := b.UnreadByte(); err == nil {
|
||||
t.Fatal("UnreadByte after ReadByte at EOF: got no error")
|
||||
}
|
||||
|
||||
// check not at EOF
|
||||
b.WriteString("abcdefghijklmnopqrstuvwxyz")
|
||||
|
||||
// after unsuccessful read
|
||||
if n, err := b.Read(nil); n != 0 || err != nil {
|
||||
t.Fatalf("Read(nil) = %d,%v; want 0,nil", n, err)
|
||||
}
|
||||
if err := b.UnreadByte(); err == nil {
|
||||
t.Fatal("UnreadByte after Read(nil): got no error")
|
||||
}
|
||||
|
||||
// after successful read
|
||||
if _, err := b.ReadBytes('m'); err != nil {
|
||||
_, err := b.ReadBytes('m')
|
||||
if err != nil {
|
||||
t.Fatalf("ReadBytes: %v", err)
|
||||
}
|
||||
if err := b.UnreadByte(); err != nil {
|
||||
|
||||
err = b.UnreadByte()
|
||||
if err != nil {
|
||||
t.Fatalf("UnreadByte: %v", err)
|
||||
}
|
||||
c, err := b.ReadByte()
|
||||
@@ -548,38 +514,6 @@ func TestBufferGrowth(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test that tryGrowByReslice is inlined.
|
||||
// Only execute on "linux-amd64" builder in order to avoid breakage.
|
||||
func TestTryGrowByResliceInlined(t *testing.T) {
|
||||
targetBuilder := "linux-amd64"
|
||||
if testenv.Builder() != targetBuilder {
|
||||
t.Skipf("%q gets executed on %q builder only", t.Name(), targetBuilder)
|
||||
}
|
||||
t.Parallel()
|
||||
goBin := testenv.GoToolPath(t)
|
||||
out, err := exec.Command(goBin, "tool", "nm", goBin).CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("go tool nm: %v: %s", err, out)
|
||||
}
|
||||
// Verify this doesn't exist:
|
||||
sym := "bytes.(*Buffer).tryGrowByReslice"
|
||||
if Contains(out, []byte(sym)) {
|
||||
t.Errorf("found symbol %q in cmd/go, but should be inlined", sym)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkWriteByte(b *testing.B) {
|
||||
const n = 4 << 10
|
||||
b.SetBytes(n)
|
||||
buf := NewBuffer(make([]byte, n))
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf.Reset()
|
||||
for i := 0; i < n; i++ {
|
||||
buf.WriteByte('x')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkWriteRune(b *testing.B) {
|
||||
const n = 4 << 10
|
||||
const r = '☺'
|
||||
|
||||
@@ -46,21 +46,36 @@ func explode(s []byte, n int) [][]byte {
|
||||
return a[0:na]
|
||||
}
|
||||
|
||||
// countGeneric actually implements Count
|
||||
func countGeneric(s, sep []byte) int {
|
||||
// special case
|
||||
if len(sep) == 0 {
|
||||
// Count counts the number of non-overlapping instances of sep in s.
|
||||
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
|
||||
func Count(s, sep []byte) int {
|
||||
n := len(sep)
|
||||
if n == 0 {
|
||||
return utf8.RuneCount(s) + 1
|
||||
}
|
||||
n := 0
|
||||
for {
|
||||
i := Index(s, sep)
|
||||
if i == -1 {
|
||||
return n
|
||||
}
|
||||
n++
|
||||
s = s[i+len(sep):]
|
||||
if n > len(s) {
|
||||
return 0
|
||||
}
|
||||
count := 0
|
||||
c := sep[0]
|
||||
i := 0
|
||||
t := s[:len(s)-n+1]
|
||||
for i < len(t) {
|
||||
if t[i] != c {
|
||||
o := IndexByte(t[i:], c)
|
||||
if o < 0 {
|
||||
break
|
||||
}
|
||||
i += o
|
||||
}
|
||||
if n == 1 || Equal(s[i:i+n], sep) {
|
||||
count++
|
||||
i += n
|
||||
continue
|
||||
}
|
||||
i++
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
// Contains reports whether subslice is within b.
|
||||
@@ -214,21 +229,20 @@ func genSplit(s, sep []byte, sepSave, n int) [][]byte {
|
||||
if n < 0 {
|
||||
n = Count(s, sep) + 1
|
||||
}
|
||||
|
||||
c := sep[0]
|
||||
start := 0
|
||||
a := make([][]byte, n)
|
||||
n--
|
||||
i := 0
|
||||
for i < n {
|
||||
m := Index(s, sep)
|
||||
if m < 0 {
|
||||
break
|
||||
na := 0
|
||||
for i := 0; i+len(sep) <= len(s) && na+1 < n; i++ {
|
||||
if s[i] == c && (len(sep) == 1 || Equal(s[i:i+len(sep)], sep)) {
|
||||
a[na] = s[start : i+sepSave]
|
||||
na++
|
||||
start = i + len(sep)
|
||||
i += len(sep) - 1
|
||||
}
|
||||
a[i] = s[:m+sepSave]
|
||||
s = s[m+len(sep):]
|
||||
i++
|
||||
}
|
||||
a[i] = s
|
||||
return a[:i+1]
|
||||
a[na] = s[start:]
|
||||
return a[0 : na+1]
|
||||
}
|
||||
|
||||
// SplitN slices s into subslices separated by sep and returns a slice of
|
||||
|
||||
@@ -4,19 +4,17 @@
|
||||
|
||||
package bytes
|
||||
|
||||
import "internal/cpu"
|
||||
|
||||
//go:noescape
|
||||
|
||||
// indexShortStr returns the index of the first instance of c in s, or -1 if c is not present in s.
|
||||
// indexShortStr requires 2 <= len(c) <= shortStringLen
|
||||
func indexShortStr(s, c []byte) int // ../runtime/asm_amd64.s
|
||||
func countByte(s []byte, c byte) int // ../runtime/asm_amd64.s
|
||||
func indexShortStr(s, c []byte) int // ../runtime/asm_$GOARCH.s
|
||||
func supportAVX2() bool // ../runtime/asm_$GOARCH.s
|
||||
|
||||
var shortStringLen int
|
||||
|
||||
func init() {
|
||||
if cpu.X86.HasAVX2 {
|
||||
if supportAVX2() {
|
||||
shortStringLen = 63
|
||||
} else {
|
||||
shortStringLen = 31
|
||||
@@ -96,15 +94,6 @@ func Index(s, sep []byte) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
// Count counts the number of non-overlapping instances of sep in s.
|
||||
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
|
||||
func Count(s, sep []byte) int {
|
||||
if len(sep) == 1 && cpu.X86.HasPOPCNT {
|
||||
return countByte(s, sep[0])
|
||||
}
|
||||
return countGeneric(s, sep)
|
||||
}
|
||||
|
||||
// primeRK is the prime base used in Rabin-Karp algorithm.
|
||||
const primeRK = 16777619
|
||||
|
||||
|
||||
@@ -39,9 +39,3 @@ func Index(s, sep []byte) int {
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
// Count counts the number of non-overlapping instances of sep in s.
|
||||
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
|
||||
func Count(s, sep []byte) int {
|
||||
return countGeneric(s, sep)
|
||||
}
|
||||
|
||||
@@ -97,12 +97,6 @@ func Index(s, sep []byte) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
// Count counts the number of non-overlapping instances of sep in s.
|
||||
// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s.
|
||||
func Count(s, sep []byte) int {
|
||||
return countGeneric(s, sep)
|
||||
}
|
||||
|
||||
// primeRK is the prime base used in Rabin-Karp algorithm.
|
||||
const primeRK = 16777619
|
||||
|
||||
|
||||
@@ -396,79 +396,6 @@ func TestIndexRune(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// test count of a single byte across page offsets
|
||||
func TestCountByte(t *testing.T) {
|
||||
b := make([]byte, 5015) // bigger than a page
|
||||
windows := []int{1, 2, 3, 4, 15, 16, 17, 31, 32, 33, 63, 64, 65, 128}
|
||||
testCountWindow := func(i, window int) {
|
||||
for j := 0; j < window; j++ {
|
||||
b[i+j] = byte(100)
|
||||
p := Count(b[i:i+window], []byte{100})
|
||||
if p != j+1 {
|
||||
t.Errorf("TestCountByte.Count(%q, 100) = %d", b[i:i+window], p)
|
||||
}
|
||||
pGeneric := CountGeneric(b[i:i+window], []byte{100})
|
||||
if pGeneric != j+1 {
|
||||
t.Errorf("TestCountByte.CountGeneric(%q, 100) = %d", b[i:i+window], p)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
maxWnd := windows[len(windows)-1]
|
||||
|
||||
for i := 0; i <= 2*maxWnd; i++ {
|
||||
for _, window := range windows {
|
||||
if window > len(b[i:]) {
|
||||
window = len(b[i:])
|
||||
}
|
||||
testCountWindow(i, window)
|
||||
for j := 0; j < window; j++ {
|
||||
b[i+j] = byte(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
for i := 4096 - (maxWnd + 1); i < len(b); i++ {
|
||||
for _, window := range windows {
|
||||
if window > len(b[i:]) {
|
||||
window = len(b[i:])
|
||||
}
|
||||
testCountWindow(i, window)
|
||||
for j := 0; j < window; j++ {
|
||||
b[i+j] = byte(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we don't count bytes outside our window
|
||||
func TestCountByteNoMatch(t *testing.T) {
|
||||
b := make([]byte, 5015)
|
||||
windows := []int{1, 2, 3, 4, 15, 16, 17, 31, 32, 33, 63, 64, 65, 128}
|
||||
for i := 0; i <= len(b); i++ {
|
||||
for _, window := range windows {
|
||||
if window > len(b[i:]) {
|
||||
window = len(b[i:])
|
||||
}
|
||||
// Fill the window with non-match
|
||||
for j := 0; j < window; j++ {
|
||||
b[i+j] = byte(100)
|
||||
}
|
||||
// Try to find something that doesn't exist
|
||||
p := Count(b[i:i+window], []byte{0})
|
||||
if p != 0 {
|
||||
t.Errorf("TestCountByteNoMatch(%q, 0) = %d", b[i:i+window], p)
|
||||
}
|
||||
pGeneric := CountGeneric(b[i:i+window], []byte{0})
|
||||
if pGeneric != 0 {
|
||||
t.Errorf("TestCountByteNoMatch.CountGeneric(%q, 100) = %d", b[i:i+window], p)
|
||||
}
|
||||
for j := 0; j < window; j++ {
|
||||
b[i+j] = byte(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var bmbuf []byte
|
||||
|
||||
func valName(x int) string {
|
||||
@@ -662,26 +589,6 @@ func BenchmarkCountEasy(b *testing.B) {
|
||||
})
|
||||
}
|
||||
|
||||
func BenchmarkCountSingle(b *testing.B) {
|
||||
benchBytes(b, indexSizes, func(b *testing.B, n int) {
|
||||
buf := bmbuf[0:n]
|
||||
step := 8
|
||||
for i := 0; i < len(buf); i += step {
|
||||
buf[i] = 1
|
||||
}
|
||||
expect := (len(buf) + (step - 1)) / step
|
||||
for i := 0; i < b.N; i++ {
|
||||
j := Count(buf, []byte{1})
|
||||
if j != expect {
|
||||
b.Fatal("bad count", j, expect)
|
||||
}
|
||||
}
|
||||
for i := 0; i < len(buf); i++ {
|
||||
buf[i] = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type ExplodeTest struct {
|
||||
s string
|
||||
n int
|
||||
@@ -1525,59 +1432,6 @@ func BenchmarkTrimSpace(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func makeBenchInputHard() []byte {
|
||||
tokens := [...]string{
|
||||
"<a>", "<p>", "<b>", "<strong>",
|
||||
"</a>", "</p>", "</b>", "</strong>",
|
||||
"hello", "world",
|
||||
}
|
||||
x := make([]byte, 0, 1<<20)
|
||||
for {
|
||||
i := rand.Intn(len(tokens))
|
||||
if len(x)+len(tokens[i]) >= 1<<20 {
|
||||
break
|
||||
}
|
||||
x = append(x, tokens[i]...)
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
var benchInputHard = makeBenchInputHard()
|
||||
|
||||
func BenchmarkSplitEmptySeparator(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
Split(benchInputHard, nil)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSplitSingleByteSeparator(b *testing.B) {
|
||||
sep := []byte("/")
|
||||
for i := 0; i < b.N; i++ {
|
||||
Split(benchInputHard, sep)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSplitMultiByteSeparator(b *testing.B) {
|
||||
sep := []byte("hello")
|
||||
for i := 0; i < b.N; i++ {
|
||||
Split(benchInputHard, sep)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSplitNSingleByteSeparator(b *testing.B) {
|
||||
sep := []byte("/")
|
||||
for i := 0; i < b.N; i++ {
|
||||
SplitN(benchInputHard, sep, 10)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSplitNMultiByteSeparator(b *testing.B) {
|
||||
sep := []byte("hello")
|
||||
for i := 0; i < b.N; i++ {
|
||||
SplitN(benchInputHard, sep, 10)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkRepeat(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
Repeat([]byte("-"), 80)
|
||||
|
||||
@@ -30,15 +30,6 @@ func ExampleBuffer_reader() {
|
||||
// Output: Gophers rule!
|
||||
}
|
||||
|
||||
func ExampleBuffer_Grow() {
|
||||
var b bytes.Buffer
|
||||
b.Grow(64)
|
||||
bb := b.Bytes()
|
||||
b.Write([]byte("64 bytes or fewer"))
|
||||
fmt.Printf("%q", bb[:b.Len()])
|
||||
// Output: "64 bytes or fewer"
|
||||
}
|
||||
|
||||
func ExampleCompare() {
|
||||
// Interpret Compare's result by comparing it to zero.
|
||||
var a, b []byte
|
||||
|
||||
@@ -7,4 +7,3 @@ package bytes
|
||||
// Export func for testing
|
||||
var IndexBytePortable = indexBytePortable
|
||||
var EqualPortable = equalPortable
|
||||
var CountGeneric = countGeneric
|
||||
|
||||
@@ -89,25 +89,16 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
|
||||
func TestAddr2Line(t *testing.T) {
|
||||
testenv.MustHaveGoBuild(t)
|
||||
|
||||
syms := loadSyms(t)
|
||||
|
||||
tmpDir, err := ioutil.TempDir("", "TestAddr2Line")
|
||||
if err != nil {
|
||||
t.Fatal("TempDir failed: ", err)
|
||||
}
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
// Build copy of test binary with debug symbols,
|
||||
// since the one running now may not have them.
|
||||
exepath := filepath.Join(tmpDir, "testaddr2line_test.exe")
|
||||
out, err := exec.Command(testenv.GoToolPath(t), "test", "-c", "-o", exepath, "cmd/addr2line").CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("go test -c -o %v cmd/addr2line: %v\n%s", exepath, err, string(out))
|
||||
}
|
||||
os.Args[0] = exepath
|
||||
|
||||
syms := loadSyms(t)
|
||||
|
||||
exepath = filepath.Join(tmpDir, "testaddr2line.exe")
|
||||
out, err = exec.Command(testenv.GoToolPath(t), "build", "-o", exepath, "cmd/addr2line").CombinedOutput()
|
||||
exepath := filepath.Join(tmpDir, "testaddr2line.exe")
|
||||
out, err := exec.Command(testenv.GoToolPath(t), "build", "-o", exepath, "cmd/addr2line").CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("go build -o %v cmd/addr2line: %v\n%s", exepath, err, string(out))
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ func main() {
|
||||
}
|
||||
|
||||
out, err := exec.Command("go", "tool", "api",
|
||||
"-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6", "go1.7", "go1.8", "go1.9"),
|
||||
"-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6", "go1.7", "go1.8"),
|
||||
"-next", file("next"),
|
||||
"-except", file("except")).CombinedOutput()
|
||||
if err != nil {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user