mirror of
https://github.com/golang/go.git
synced 2026-01-30 15:42:04 +03:00
Compare commits
13 Commits
go1.9.7
...
dev.garbag
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d4942afe0 | ||
|
|
8b25a00e6d | ||
|
|
42afbd9e63 | ||
|
|
f9f6c90ed1 | ||
|
|
69161e279e | ||
|
|
fb4c718209 | ||
|
|
81b74bf9c5 | ||
|
|
edb54c300f | ||
|
|
312aa09996 | ||
|
|
d491e550c3 | ||
|
|
641c32dafa | ||
|
|
2e495a1df6 | ||
|
|
344476d23c |
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
56
README.md
56
README.md
@@ -4,42 +4,40 @@ 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].*
|
||||
|
||||
For documentation about how to install and use Go,
|
||||
visit https://golang.org/ or load doc/install-source.html
|
||||
in your web browser.
|
||||
|
||||
Our canonical Git repository is located at https://go.googlesource.com/go.
|
||||
There is a mirror of the repository at https://github.com/golang/go.
|
||||
|
||||
Unless otherwise noted, the Go source files are distributed under the
|
||||
BSD-style license found in the LICENSE file.
|
||||
|
||||
### Download and Install
|
||||
|
||||
#### Binary Distributions
|
||||
|
||||
Official binary distributions are available at https://golang.org/dl/.
|
||||
|
||||
After downloading a binary release, visit https://golang.org/doc/install
|
||||
or load doc/install.html in your web browser for installation
|
||||
instructions.
|
||||
|
||||
#### Install From Source
|
||||
|
||||
If a binary distribution is not available for your combination of
|
||||
operating system and architecture, visit
|
||||
https://golang.org/doc/install/source or load doc/install-source.html
|
||||
in your web browser for source installation instructions.
|
||||
|
||||
### Contributing
|
||||
|
||||
Go is the work of hundreds of contributors. We appreciate your help!
|
||||
|
||||
To contribute, please read the contribution guidelines:
|
||||
https://golang.org/doc/contribute.html
|
||||
|
||||
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.
|
||||
##### Note that we do not accept pull requests and that we use the issue tracker for bug reports and proposals only. Please ask questions on https://forum.golangbridge.org or https://groups.google.com/forum/#!forum/golang-nuts.
|
||||
|
||||
[rf]: https://reneefrench.blogspot.com/
|
||||
[cc3-by]: https://creativecommons.org/licenses/by/3.0/
|
||||
Unless otherwise noted, the Go source files are distributed
|
||||
under the BSD-style license found in the LICENSE file.
|
||||
|
||||
--
|
||||
|
||||
## Binary Distribution Notes
|
||||
|
||||
If you have just untarred a binary Go distribution, you need to set
|
||||
the environment variable $GOROOT to the full path of the go
|
||||
directory (the one containing this file). You can omit the
|
||||
variable if you unpack it into /usr/local/go, or if you rebuild
|
||||
from sources by running all.bash (see doc/install-source.html).
|
||||
You should also add the Go binary directory $GOROOT/bin
|
||||
to your shell's path.
|
||||
|
||||
For example, if you extracted the tar file into $HOME/go, you might
|
||||
put the following in your .profile:
|
||||
|
||||
export GOROOT=$HOME/go
|
||||
export PATH=$PATH:$GOROOT/bin
|
||||
|
||||
See https://golang.org/doc/install or doc/install.html for more details.
|
||||
|
||||
@@ -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
|
||||
|
||||
10
doc/cmd.html
10
doc/cmd.html
@@ -22,7 +22,7 @@ using the go <code>tool</code> subcommand, such as <code>go tool vet</code>.
|
||||
This style of invocation allows, for instance, checking a single source file
|
||||
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
|
||||
Some of the commands, such as <code>yacc</code>, are accessible only through
|
||||
the go <code>tool</code> subcommand.
|
||||
</p>
|
||||
|
||||
@@ -62,7 +62,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>
|
||||
@@ -95,6 +95,12 @@ gofmt</a> command with more general options.</td>
|
||||
calls whose arguments do not align with the format string.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="/cmd/yacc/">yacc</a></td>
|
||||
<td> </td>
|
||||
<td>Yacc is a version of yacc that generates parsers implemented in Go.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -148,26 +148,29 @@ These actions are explicitly forbidden in Go spaces:
|
||||
|
||||
<p>
|
||||
The Go spaces are not free speech venues; they are for discussion about Go.
|
||||
Each of these spaces have their own moderators.
|
||||
These spaces have moderators.
|
||||
The goal of the moderators is to facilitate civil discussion about Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When using the official Go spaces you should act in the spirit of the “Gopher
|
||||
values”.
|
||||
If a reported conflict cannot be resolved amicably, the CoC Working Group
|
||||
may make a recommendation to the relevant forum moderators.
|
||||
If you conduct yourself in a way that is explicitly forbidden by the CoC,
|
||||
you will be warned and asked to stop.
|
||||
If you do not stop, you will be removed from our community spaces temporarily.
|
||||
Repeated, willful breaches of the CoC will result in a permanent ban.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
CoC Working Group members and forum moderators are held to a higher standard than other community members.
|
||||
If a working group member or moderator creates an inappropriate situation, they
|
||||
should expect less leeway than others, and should expect to be removed from
|
||||
their position if they cannot adhere to the CoC.
|
||||
Moderators are held to a higher standard than other community members.
|
||||
If a moderator creates an inappropriate situation, they should expect less
|
||||
leeway than others, and should expect to be removed from their position if they
|
||||
cannot adhere to the CoC.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Complaints about working group member or moderator actions must be handled
|
||||
using the reporting process below.
|
||||
Complaints about moderator actions must be handled using the reporting process
|
||||
below.
|
||||
</p>
|
||||
|
||||
<h2 id="reporting">Reporting issues</h2>
|
||||
@@ -182,6 +185,8 @@ satisfaction of all parties. They are:
|
||||
<ul>
|
||||
<li>Aditya Mukerjee <dev@chimeracoder.net>
|
||||
<li>Andrew Gerrand <adg@golang.org>
|
||||
<li>Dave Cheney <dave@cheney.net>
|
||||
<li>Jason Buberel <jbuberel@google.com>
|
||||
<li>Peggy Li <peggyli.224@gmail.com>
|
||||
<li>Sarah Adams <sadams.codes@gmail.com>
|
||||
<li>Steve Francia <steve.francia@gmail.com>
|
||||
@@ -196,10 +201,13 @@ particular individual or group.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a>.
|
||||
<li>Mail <a href="mailto:conduct@golang.org">conduct@golang.org</a> or
|
||||
<a href="https://golang.org/s/conduct-report">submit an anonymous report</a>.
|
||||
<ul>
|
||||
<li>Your message will reach the Working Group.
|
||||
<li>Reports are confidential within the Working Group.
|
||||
<li>Should you choose to remain anonymous then the Working Group cannot
|
||||
notify you of the outcome of your report.
|
||||
<li>You may contact a member of the group directly if you do not feel
|
||||
comfortable contacting the group as a whole. That member will then raise
|
||||
the issue with the Working Group as a whole, preserving the privacy of the
|
||||
@@ -221,8 +229,11 @@ particular individual or group.
|
||||
<li>The Working Group will reach a decision as to how to act. These may include:
|
||||
<ul>
|
||||
<li>Nothing.
|
||||
<li>Passing the report along to the offender.
|
||||
<li>A recommendation of action to the relevant forum moderators.
|
||||
<li>A request for a private or public apology.
|
||||
<li>A private or public warning.
|
||||
<li>An imposed vacation (for instance, asking someone to abstain for a week
|
||||
from a mailing list or IRC).
|
||||
<li>A permanent or temporary ban from some or all Go spaces.
|
||||
</ul>
|
||||
<li>The Working Group will reach out to the original reporter to let them know
|
||||
the decision.
|
||||
@@ -235,6 +246,7 @@ particular individual or group.
|
||||
conflicts in the most harmonious way possible.</b>
|
||||
We hope that in most cases issues may be resolved through polite discussion and
|
||||
mutual agreement.
|
||||
Bannings and other forceful measures are to be employed only as a last resort.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -34,8 +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>
|
||||
<li><a href="/doc/go1.5">Go 1.5</a> <small>(August 2015)</small></li>
|
||||
@@ -117,6 +115,6 @@ guidelines</a> for information on design, testing, and our code review process.
|
||||
<p>
|
||||
Check <a href="//golang.org/issue">the tracker</a> for
|
||||
open issues that interest you. Those labeled
|
||||
<a href="https://github.com/golang/go/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22">help wanted</a>
|
||||
<a href="https://github.com/golang/go/issues?q=is%3Aopen+is%3Aissue+label%3Ahelpwanted">helpwanted</a>
|
||||
are particularly in need of outside help.
|
||||
</p>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<!--{
|
||||
"Title": "Contribution Guide"
|
||||
"Title": "Contribution Guidelines"
|
||||
}-->
|
||||
|
||||
<h2 id="Introduction">Introduction</h2>
|
||||
|
||||
<p>
|
||||
The Go project welcomes all contributors. The process of contributing
|
||||
to the Go project may be different than many projects you are used to.
|
||||
This document is intended as a guide to help you through the contribution
|
||||
process. This guide assumes you have a basic understanding of Git and Go.
|
||||
This document explains how to contribute changes to the Go project.
|
||||
It assumes you have followed the
|
||||
<a href="/doc/install/source">installation instructions</a> and
|
||||
have <a href="code.html">written and tested your code</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -18,73 +20,103 @@ see <a href="gccgo_contribute.html">Contributing to gccgo</a>.)
|
||||
Sensitive security-related issues should be reported to <a href="mailto:security@golang.org">security@golang.org</a>.
|
||||
</p>
|
||||
|
||||
<h1 id="contributor">Becoming a contributor</h1>
|
||||
<h2 id="Design">Discuss your design</h2>
|
||||
|
||||
<p>
|
||||
Before you can contribute to the Go project you need to setup a few prerequisites.
|
||||
The Go project uses <a href="https://www.gerritcodereview.com/">Gerrit</a>, an open
|
||||
source online tool, to perform all code reviews.
|
||||
Gerrit uses your email address as a unique identifier.
|
||||
The Go project contributing flow is currently configured to work only with Google Accounts.
|
||||
You must go through the following process <em>prior to contributing</em>.
|
||||
You only need to do this once per Google Account.
|
||||
The project welcomes submissions but please let everyone know what
|
||||
you're working on if you want to change or add to the Go repositories.
|
||||
</p>
|
||||
|
||||
<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:
|
||||
Before undertaking to write something new for the Go project,
|
||||
please <a href="https://golang.org/issue/new">file an issue</a>
|
||||
(or claim an <a href="https://golang.org/issues">existing issue</a>).
|
||||
Significant changes must go through the
|
||||
<a href="https://golang.org/s/proposal-process">change proposal process</a>
|
||||
before they can be accepted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This process gives everyone a chance to validate the design,
|
||||
helps prevent duplication of effort,
|
||||
and ensures that the idea fits inside the goals for the language and tools.
|
||||
It also checks that the design is sound before code is written;
|
||||
the code review tool is not the place for high-level discussions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When planning work, please note that the Go project follows a
|
||||
<a href="https://golang.org/wiki/Go-Release-Cycle">six-month
|
||||
development cycle</a>. The latter half of each cycle is a three-month
|
||||
feature freeze during which only bug fixes and doc updates are accepted.
|
||||
New work cannot be submitted during a feature freeze.
|
||||
</p>
|
||||
|
||||
<h2 id="Testing">Testing redux</h2>
|
||||
|
||||
<p>
|
||||
You've <a href="code.html">written and tested your code</a>, but
|
||||
before sending code out for review, run all the tests for the whole
|
||||
tree to make sure the changes don't break other packages or programs:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get -u golang.org/x/tools/cmd/go-contrib-init
|
||||
$ cd /code/to/edit
|
||||
$ go-contrib-init
|
||||
$ cd go/src
|
||||
$ ./all.bash
|
||||
</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.
|
||||
You should already have Git installed.
|
||||
(To build under Windows use <code>all.bat</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Gerrit uses Google Accounts for authentication.
|
||||
If you don't have a Google Account, you can create an account which
|
||||
After running for a while, the command should print
|
||||
"<code>ALL</code> <code>TESTS</code> <code>PASSED</code>".
|
||||
</p>
|
||||
|
||||
<h2 id="Code_review">Code review</h2>
|
||||
|
||||
<p>
|
||||
Changes to Go must be reviewed before they are accepted,
|
||||
no matter who makes the change.
|
||||
A custom git command called <code>git-codereview</code>,
|
||||
discussed below, helps manage the code review process through a Google-hosted
|
||||
<a href="https://go-review.googlesource.com/">instance</a> of the code review
|
||||
system called <a href="https://www.gerritcodereview.com/">Gerrit</a>.
|
||||
</p>
|
||||
|
||||
<h3 id="auth">Set up authentication for code review</h3>
|
||||
|
||||
<p>
|
||||
Gerrit uses Google Accounts for authentication. If you don't have
|
||||
a Google Account, you can create an account which
|
||||
<a href="https://www.google.com/accounts/NewAccount">includes
|
||||
a new Gmail email account</a> or create an account associated
|
||||
<a href="https://accounts.google.com/SignUpWithoutGmail">with your existing
|
||||
email address</a>.
|
||||
</p>
|
||||
|
||||
<h3>Step 1: Sign in to googlesource and generate a password</h3>
|
||||
<p>
|
||||
The email address associated with the Google Account you use will be recorded in
|
||||
the <a href="https://go.googlesource.com/go/+log/">change log</a>
|
||||
and in the <a href="/CONTRIBUTORS">contributors file</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Visit <a href="https://go.googlesource.com">go.googlesource.com</a>
|
||||
To set up your account in Gerrit, visit
|
||||
<a href="https://go.googlesource.com">go.googlesource.com</a>
|
||||
and click on "Generate Password" in the page's top right menu bar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You will be redirected to accounts.google.com to sign in.
|
||||
</p>
|
||||
|
||||
<h3>Step 2: Run the provided script</h3>
|
||||
<p>
|
||||
After signing in, you are taken to a page on go.googlesource.com with the title "Configure Git".
|
||||
This page contains a personalized script which when run locally will configure git
|
||||
to have your unique authentication key.
|
||||
This key is paired with one generated server side similar to how ssh keys work.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Copy and run this script locally in your command line terminal.
|
||||
(On a Windows computer using cmd you should instead follow the instructions
|
||||
in the yellow box to run the command. If you are using git-bash use the same
|
||||
script as *nix.)
|
||||
Once signed in, you are returned back to go.googlesource.com to "Configure Git".
|
||||
Follow the instructions on the page.
|
||||
(If you are on a Windows computer, you should instead follow the instructions
|
||||
in the yellow box to run the command.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -92,25 +124,23 @@ Your secret authentication token is now in a <code>.gitcookie</code> file
|
||||
and Git is configured to use this file.
|
||||
</p>
|
||||
|
||||
<h3 id="gerrit">Step 3: Register with Gerrit</h3>
|
||||
<h3 id="gerrit">Register with Gerrit</h3>
|
||||
|
||||
<p>
|
||||
Now that you have your authentication token, you need to register your
|
||||
account with Gerrit.
|
||||
To do this, visit <a href="https://go-review.googlesource.com/login/">
|
||||
go-review.googlesource.com/login/</a>.
|
||||
Sign in using the same Google Account you used above.
|
||||
Now that you have your authentication token,
|
||||
you need to register your account with Gerrit.
|
||||
To do this, visit
|
||||
<a href="https://go-review.googlesource.com/login/">
|
||||
go-review.googlesource.com/login/</a>. You will immediately be redirected
|
||||
to Google Accounts. Sign in using the same Google Account you used above.
|
||||
That is all that is required.
|
||||
</p>
|
||||
|
||||
<h2 id="cla">Contributor License Agreement</h2>
|
||||
|
||||
<h3 id="which_cla">Which CLA</h3>
|
||||
<p>
|
||||
Before sending your first change to the Go project
|
||||
you must have completed one of the following two CLAs.
|
||||
Which CLA you should sign depends on who owns the copyright to your work.
|
||||
</p>
|
||||
<h3 id="cla">Contributor License Agreement</h3>
|
||||
|
||||
<p>Gerrit serves as the gatekeeper and uses your e-mail address as the key.
|
||||
To send your first change to the Go project from a given address,
|
||||
you must have completed one of the contributor license agreements:
|
||||
<ul>
|
||||
<li>
|
||||
If you are the copyright holder, you will need to agree to the
|
||||
@@ -121,49 +151,37 @@ contributor license agreement</a>, which can be completed online.
|
||||
If your organization is the copyright holder, the organization
|
||||
will need to agree to the
|
||||
<a href="https://developers.google.com/open-source/cla/corporate">corporate
|
||||
contributor license agreement</a>.<br>
|
||||
contributor license agreement</a>.
|
||||
(If the copyright holder for your code has already completed the
|
||||
agreement in connection with another Google open source project,
|
||||
it does not need to be completed again.)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<i>If the copyright holder for your contribution has already completed the
|
||||
agreement in connection with another Google open source project,
|
||||
it does not need to be completed again.</i>
|
||||
</p>
|
||||
|
||||
<h3 id="signing_cla">Completing the CLA</h3>
|
||||
|
||||
<p>
|
||||
You can see your currently signed agreements and sign new ones through the Gerrit
|
||||
interface.
|
||||
To do this, <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
|
||||
then visit the <a href="https://go-review.googlesource.com/settings/agreements">Agreements</a>
|
||||
page.
|
||||
If you do not have a signed agreement listed there, you can create one
|
||||
by clicking "New Contributor Agreement" and following the steps.
|
||||
You can use the links above to create and sign the contributor license agreement
|
||||
or you can show your current agreements and create new ones through the Gerrit
|
||||
interface. <a href="https://go-review.googlesource.com/login/">Log into Gerrit</a>,
|
||||
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>
|
||||
If the copyright holder for the code you are submitting changes — for example,
|
||||
if you start contributing code on behalf of a new company — please send email
|
||||
to golang-dev and let us know, so that we can make sure an appropriate agreement is
|
||||
completed and update the <code>AUTHORS</code> file.
|
||||
This rigmarole only needs to be done for your first submission for each email address.
|
||||
</p>
|
||||
|
||||
<span id="Code_review"></span>
|
||||
<h1 id="prepare_dev_env">Preparing a Development Environment for Contributing</h1>
|
||||
|
||||
<h2 id="git-codereview">Setting up Git for submission to Gerrit</h2>
|
||||
<p>
|
||||
Changes to Go must be reviewed before they are accepted, no matter who makes the change.
|
||||
A custom git command called <code>git-codereview</code>, discussed below,
|
||||
helps manage the code review process through a Google-hosted
|
||||
<a href="https://go-review.googlesource.com/">instance</a> Gerrit.
|
||||
If the copyright holder for the code you are submitting changes—for example,
|
||||
if you start contributing code on behalf of a new company—please send email
|
||||
to let us know, so that we can make sure an appropriate agreement is completed
|
||||
and update the <code>AUTHORS</code> file.
|
||||
</p>
|
||||
|
||||
<h3 id="git-codereview_install">Install the git-codereview command</h3>
|
||||
<h3 id="git-codereview">Install the git-codereview command</h3>
|
||||
|
||||
<p>
|
||||
Install the <code>git-codereview</code> command by running,
|
||||
Now install the <code>git-codereview</code> command by running,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -183,29 +201,19 @@ $ git codereview help
|
||||
prints help text, not an error.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
On Windows, when using git-bash you must make sure that
|
||||
<code>git-codereview.exe</code> is in your git exec-path.
|
||||
Run <code>git --exec-path</code> to discover the right location then create a
|
||||
symbolic link or simply copy the executible from $GOPATH/bin to this directory.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Note to Git aficionados:</b>
|
||||
The <code>git-codereview</code> command is not required to
|
||||
upload and manage Gerrit code reviews.
|
||||
For those who prefer plain Git, the text below gives the Git equivalent of
|
||||
each git-codereview command.
|
||||
upload and manage Gerrit code reviews. For those who prefer plain Git, the text
|
||||
below gives the Git equivalent of each git-codereview command.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you do use plain Git, note that you still need the commit hooks that the
|
||||
git-codereview command configures; those hooks add a Gerrit
|
||||
<code>Change-Id</code> line to the commit message and check that all Go source
|
||||
files have been formatted with gofmt.
|
||||
Even if you intend to use plain Git for
|
||||
daily work, install the hooks in a new Git checkout by running
|
||||
<code>git-codereview</code> <code>hooks</code>.
|
||||
<p>If you do use plain
|
||||
Git, note that you still need the commit hooks that the git-codereview command
|
||||
configures; those hooks add a Gerrit <code>Change-Id</code> line to the commit
|
||||
message and check that all Go source files have been formatted with gofmt. Even
|
||||
if you intend to use plain Git for daily work, install the hooks in a new Git
|
||||
checkout by running <code>git-codereview</code> <code>hooks</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -256,8 +264,7 @@ To install them, copy this text into your Git configuration file
|
||||
sync = codereview sync
|
||||
</pre>
|
||||
|
||||
<span id="help"></span>
|
||||
<h3 id="understanding_git-codereview">Understanding the git-codereview command</h3>
|
||||
<h3 id="help">Understanding the git-codereview command</h3>
|
||||
|
||||
<p>After installing the <code>git-codereview</code> command, you can run</p>
|
||||
|
||||
@@ -270,70 +277,11 @@ to learn more about its commands.
|
||||
You can also read the <a href="https://godoc.org/golang.org/x/review/git-codereview">command documentation</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<h1 id="making_a_contribution">Making a Contribution</h1>
|
||||
|
||||
<h2 id="Design">Discuss your design</h2>
|
||||
|
||||
<p>
|
||||
The project welcomes submissions but please let everyone know what
|
||||
you're working on if you want to change or add to the Go repositories.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Before undertaking to write something new for the Go project,
|
||||
please <a href="https://golang.org/issue/new">file an issue</a>
|
||||
(or claim an <a href="https://golang.org/issues">existing issue</a>).
|
||||
Significant changes must go through the
|
||||
<a href="https://golang.org/s/proposal-process">change proposal process</a>
|
||||
before they can be accepted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This process gives everyone a chance to validate the design,
|
||||
helps prevent duplication of effort,
|
||||
and ensures that the idea fits inside the goals for the language and tools.
|
||||
It also checks that the design is sound before code is written;
|
||||
the code review tool is not the place for high-level discussions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When planning work, please note that the Go project follows a <a
|
||||
href="https://golang.org/wiki/Go-Release-Cycle">six-month development cycle</a>.
|
||||
The latter half of each cycle is a three-month feature freeze during
|
||||
which only bug fixes and doc updates are accepted. New contributions can be
|
||||
sent during a feature freeze but will not be accepted until the freeze thaws.
|
||||
</p>
|
||||
|
||||
<h2 id="making_a_change">Making a change</h2>
|
||||
|
||||
<h3 id="checkout_go">Getting Go Source</h3>
|
||||
<p>
|
||||
First you need to have a local copy of the source checked out from the correct
|
||||
repository.
|
||||
As Go builds Go you will also likely need to have a working version
|
||||
of Go installed (some documentation changes may not need this).
|
||||
This should be a recent version of Go and can be obtained via any package or
|
||||
binary distribution or you can build it from source.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You should checkout the Go source repo anywhere you want as long as it's
|
||||
outside of your $GOPATH.
|
||||
Go to a directory where you want the source to appear and run the following
|
||||
command in a terminal.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
$ cd go
|
||||
</pre>
|
||||
|
||||
<h3 id="master">Contributing to the main Go tree</h3>
|
||||
<h3 id="master">Switch to the master branch</h3>
|
||||
|
||||
<p>
|
||||
Most Go installations use a release branch, but new changes should
|
||||
only be made based on the master branch. <br>
|
||||
only be made based on the master branch.
|
||||
(They may be applied later to a release branch as part of the release process,
|
||||
but most contributors won't do this themselves.)
|
||||
Before making a change, make sure you start on the master branch:
|
||||
@@ -349,61 +297,10 @@ $ git sync
|
||||
<code>git</code> <code>pull</code> <code>-r</code>.)
|
||||
</p>
|
||||
|
||||
<h3 id="subrepos">Contributing to subrepositories (golang.org/x/...)</h3>
|
||||
|
||||
<p>
|
||||
If you are contributing a change to a subrepository, obtain the
|
||||
Go package using <code>go get</code>. For example, to contribute
|
||||
to <code>golang.org/x/oauth2</code>, check out the code by running:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ go get -d golang.org/x/oauth2/...
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Then, change your directory to the package's source directory
|
||||
(<code>$GOPATH/src/golang.org/x/oauth2</code>).
|
||||
</p>
|
||||
|
||||
<h3 id="change">Make your changes</h3>
|
||||
|
||||
<p>
|
||||
The entire checked-out tree is editable.
|
||||
Make your changes as you see fit ensuring that you create appropriate
|
||||
tests along with your changes. Test your changes as you go.
|
||||
</p>
|
||||
|
||||
<h3 id="copyright">Copyright</h3>
|
||||
|
||||
<p>
|
||||
Files in the Go repository don't list author names, both to avoid clutter
|
||||
and to avoid having to keep the lists up to date.
|
||||
Instead, your name will appear in the
|
||||
<a href="https://golang.org/change">change log</a> and in the <a
|
||||
href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file and perhaps the <a
|
||||
href="/AUTHORS"><code>AUTHORS</code></a> file.
|
||||
These files are automatically generated from the commit logs perodically.
|
||||
The <a href="/AUTHORS"><code>AUTHORS</code></a> file defines who “The Go
|
||||
Authors”—the copyright holders—are.
|
||||
</p>
|
||||
|
||||
<p>New files that you contribute should use the standard copyright header:</p>
|
||||
|
||||
<pre>
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Files in the repository are copyright the year they are added.
|
||||
Do not update the copyright year on files that you change.
|
||||
</p>
|
||||
|
||||
<h3 id="commit_changes">Commit your changes</h3>
|
||||
<h3 id="change">Make a change</h3>
|
||||
|
||||
<p>
|
||||
The entire checked-out tree is writable.
|
||||
Once you have edited files, you must tell Git that they have been modified.
|
||||
You must also tell Git about any files that are added, removed, or renamed files.
|
||||
These operations are done with the usual Git commands,
|
||||
@@ -414,20 +311,16 @@ and
|
||||
</p>
|
||||
|
||||
<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.
|
||||
</p>
|
||||
If you wish to checkpoint your work, or are ready to send the code out for review, run</p>
|
||||
|
||||
<pre>
|
||||
$ git change <i><branch></i>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
from any directory in your Go repository to commit the changes so far.
|
||||
The name <i><branch></i> is an arbitrary one you choose to identify the
|
||||
local branch containing your changes and will not be used elsewhere.
|
||||
This is an offline operation and nothing will be sent to the server yet.
|
||||
local branch containing your changes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -438,11 +331,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,
|
||||
Git will open a change description file in your editor.
|
||||
(It uses the editor named by the <code>$EDITOR</code> environment variable,
|
||||
<code>vi</code> by default.)
|
||||
|
||||
The file will look like:
|
||||
</p>
|
||||
|
||||
@@ -461,7 +352,7 @@ At the beginning of this file is a blank line; replace it
|
||||
with a thorough description of your change.
|
||||
The first line of the change description is conventionally a one-line
|
||||
summary of the change, prefixed by the primary affected package,
|
||||
and is used as the subject for code review email.
|
||||
and is used as the subject for code review mail.
|
||||
It should complete the sentence "This change modifies Go to _____."
|
||||
The rest of the description elaborates and should provide context for the
|
||||
change and explain what it does.
|
||||
@@ -496,7 +387,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>
|
||||
@@ -504,7 +395,7 @@ the command and move that file to a different branch.
|
||||
<p>
|
||||
The special notation "Fixes #159" associates the change with issue 159 in the
|
||||
<a href="https://golang.org/issue/159">Go issue tracker</a>.
|
||||
When this change is eventually applied, the issue
|
||||
When this change is eventually submitted, the issue
|
||||
tracker will automatically mark the issue as fixed.
|
||||
(There are several such conventions, described in detail in the
|
||||
<a href="https://help.github.com/articles/closing-issues-via-commit-messages/">GitHub Issue Tracker documentation</a>.)
|
||||
@@ -515,13 +406,6 @@ Once you have finished writing the commit message,
|
||||
save the file and exit the editor.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You must have the $EDITOR environment variable set properly and working properly (exiting cleanly)
|
||||
for this operation to succeed.
|
||||
If you run into any issues at this step, it's likely your editor isn't exiting cleanly.
|
||||
Try setting a different editor in your $EDITOR environment variable.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you wish to do more editing, re-stage your changes using
|
||||
<code>git</code> <code>add</code>, and then run
|
||||
@@ -532,8 +416,8 @@ $ git change
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
to update the change description and incorporate the staged changes.
|
||||
The change description contains a <code>Change-Id</code> line near the bottom,
|
||||
to update the change description and incorporate the staged changes. The
|
||||
change description contains a <code>Change-Id</code> line near the bottom,
|
||||
added by a Git commit hook during the initial
|
||||
<code>git</code> <code>change</code>.
|
||||
That line is used by Gerrit to match successive uploads of the same change.
|
||||
@@ -545,44 +429,35 @@ Do not edit or delete it.
|
||||
runs <code>git</code> <code>commit</code> <code>--amend</code>.)
|
||||
</p>
|
||||
|
||||
<h3 id="Testing">Testing</h3>
|
||||
<h3 id="mail">Mail the change for review</h3>
|
||||
|
||||
<p>
|
||||
You've <a href="code.html">written and tested your code</a>, but
|
||||
before sending code out for review, run all the tests for the whole
|
||||
tree to make sure the changes don't break other packages or programs:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ cd go/src
|
||||
$ ./all.bash
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
(To build under Windows use <code>all.bat</code>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
After running for a while, the command should print
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
"ALL TESTS PASSED".
|
||||
</pre>
|
||||
|
||||
<h3 id="mail">Send the change for review</h3>
|
||||
|
||||
<p>
|
||||
Once the change is ready, send it for review.
|
||||
This is similar to a <code>git push</code> in a GitHub style workflow.
|
||||
This is done via the mail alias setup earlier which despite its name, doesn't
|
||||
directly mail anything, it simply sends the change to Gerrit via git push.
|
||||
Once the change is ready, mail it out for review:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
You can specify a reviewer or CC interested parties
|
||||
using the <code>-r</code> or <code>-cc</code> options.
|
||||
Both accept a comma-separated list of email addresses:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Unless explicitly told otherwise, such as in the discussion leading
|
||||
up to sending in the change list, it's better not to specify a reviewer.
|
||||
All changes are automatically CC'ed to the
|
||||
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
|
||||
mailing list. If this is your first ever change, there may be a moderation
|
||||
delay before it appears on the mailing list, to prevent spam.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
(In Git terms, <code>git</code> <code>mail</code> pushes the local committed
|
||||
changes to Gerrit using <code>git</code> <code>push</code> <code>origin</code>
|
||||
@@ -591,7 +466,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>
|
||||
@@ -604,76 +479,7 @@ remote: New Changes:
|
||||
remote: https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
|
||||
</pre>
|
||||
|
||||
<h3>Troubleshooting</h3>
|
||||
|
||||
<p>
|
||||
The most common way that the <code>git mail</code> command fails is because the
|
||||
email address used has not gone through the setup above.
|
||||
<br>
|
||||
If you see something like...
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
remote: Processing changes: refs: 1, done
|
||||
remote:
|
||||
remote: ERROR: In commit ab13517fa29487dcf8b0d48916c51639426c5ee9
|
||||
remote: ERROR: author email address XXXXXXXXXXXXXXXXXXX
|
||||
remote: ERROR: does not match your user account.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
You need to either add the email address listed to the CLA or set this repo to use
|
||||
another email address already approved.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First let's change the email address for this repo so this doesn't happen again.
|
||||
You can change your email address for this repo with the following command:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git config user.email email@address.com
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Then change the previous commit to use this alternative email address.
|
||||
You can do that with:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git commit --amend --author="Author Name <email@address.com>"
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Finally try to resend with:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail
|
||||
</pre>
|
||||
|
||||
<h3 id="cc">Specifying a reviewer / CCing others</h3>
|
||||
|
||||
<p>
|
||||
Unless explicitly told otherwise, such as in the discussion leading
|
||||
up to sending in the change, it's better not to specify a reviewer.
|
||||
All changes are automatically CC'ed to the
|
||||
<a href="https://groups.google.com/group/golang-codereviews">golang-codereviews@googlegroups.com</a>
|
||||
mailing list. If this is your first ever change, there may be a moderation
|
||||
delay before it appears on the mailing list, to prevent spam.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can specify a reviewer or CC interested parties
|
||||
using the <code>-r</code> or <code>-cc</code> options.
|
||||
Both accept a comma-separated list of email addresses:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
|
||||
</pre>
|
||||
|
||||
<h2 id="review">Going through the review process</h2>
|
||||
<h3 id="review">Reviewing code</h3>
|
||||
|
||||
<p>
|
||||
Running <code>git</code> <code>mail</code> will send an email to you and the
|
||||
@@ -685,15 +491,7 @@ You must reply through the web interface.
|
||||
(Unlike with the old Rietveld review system, replying by mail has no effect.)
|
||||
</p>
|
||||
|
||||
<h3 id="revise">Revise and resend</h3>
|
||||
|
||||
<p>
|
||||
The Go contribution workflow is optimized for iterative revisions based on
|
||||
feedback.
|
||||
It is rare that an initial contribution will be ready to be applied as is.
|
||||
As you revise your contribution and resend Gerrit will retain a history of
|
||||
all the changes and comments made in the single URL.
|
||||
</p>
|
||||
<h3 id="revise">Revise and upload</h3>
|
||||
|
||||
<p>
|
||||
You must respond to review comments through the web interface.
|
||||
@@ -704,7 +502,7 @@ You must respond to review comments through the web interface.
|
||||
When you have revised the code and are ready for another round of review,
|
||||
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>
|
||||
|
||||
@@ -736,8 +534,6 @@ $ git sync
|
||||
<code>git</code> <code>pull</code> <code>-r</code>.)
|
||||
</p>
|
||||
|
||||
<h3 id="resolving_conflicts">Resolving Conflicts</h3>
|
||||
|
||||
<p>
|
||||
If files you were editing have changed, Git does its best to merge the
|
||||
remote changes into your local changes.
|
||||
@@ -813,8 +609,8 @@ might turn up:
|
||||
<p>
|
||||
Git doesn't show it, but suppose the original text that both edits
|
||||
started with was 1e8; you changed it to 1e10 and the other change to 1e9,
|
||||
so the correct answer might now be 1e10.
|
||||
First, edit the section to remove the markers and leave the correct code:
|
||||
so the correct answer might now be 1e10. First, edit the section
|
||||
to remove the markers and leave the correct code:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -843,13 +639,10 @@ restore the change commit.
|
||||
<h3 id="download">Reviewing code by others</h3>
|
||||
|
||||
<p>
|
||||
As part of the review process reviewers can propose changes directly (in the
|
||||
GitHub workflow this would be someone else attaching commits to a pull request).
|
||||
|
||||
You can import these changes proposed by someone else into your local Git repository.
|
||||
You can import a change proposed by someone else into your local Git repository.
|
||||
On the Gerrit review page, click the "Download ▼" link in the upper right
|
||||
corner, copy the "Checkout" command and run it from your local Git repo. It
|
||||
should look something like this:
|
||||
corner, copy the "Checkout" command and run it from your local Git repo.
|
||||
It should look something like this:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -860,11 +653,11 @@ $ git fetch https://go.googlesource.com/review refs/changes/21/1221/1 &&
|
||||
To revert, change back to the branch you were working in.
|
||||
</p>
|
||||
|
||||
<h2 id="submit">Apply the change to the master branch</h2>
|
||||
<h3 id="submit">Submit the change after the review</h3>
|
||||
|
||||
<p>
|
||||
After the code has been <code>LGTM</code>'ed, an approver may
|
||||
apply it to the master branch using the Gerrit UI.
|
||||
submit it to the master branch using the Gerrit UI.
|
||||
There is a "Submit" button on the web page for the change
|
||||
that appears once the change is approved (marked +2).
|
||||
</p>
|
||||
@@ -876,13 +669,41 @@ and the code review will be updated with a link to the change
|
||||
in the repository.
|
||||
Since the method used to integrate the changes is "Cherry Pick",
|
||||
the commit hashes in the repository will be changed by
|
||||
the "Submit" operation.
|
||||
the submit operation.
|
||||
</p>
|
||||
|
||||
<h2 id="more">More information</h2>
|
||||
<h3 id="more">More information</h3>
|
||||
|
||||
<p>
|
||||
In addition to the information here, the Go community maintains a <a
|
||||
href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
|
||||
In addition to the information here, the Go community maintains a <a href="https://golang.org/wiki/CodeReview">CodeReview</a> wiki page.
|
||||
Feel free to contribute to this page as you learn the review process.
|
||||
</p>
|
||||
|
||||
<h2 id="copyright">Copyright</h2>
|
||||
|
||||
<p>Files in the Go repository don't list author names,
|
||||
both to avoid clutter and to avoid having to keep the lists up to date.
|
||||
Instead, your name will appear in the
|
||||
<a href="https://golang.org/change">change log</a>
|
||||
and in the <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
|
||||
and perhaps the <a href="/AUTHORS"><code>AUTHORS</code></a> file.
|
||||
</p>
|
||||
|
||||
<p>The <a href="/CONTRIBUTORS"><code>CONTRIBUTORS</code></a> file
|
||||
defines who the Go contributors—the people—are;
|
||||
the <a href="/AUTHORS"><code>AUTHORS</code></a> file defines
|
||||
who “The Go Authors”—the copyright holders—are.
|
||||
These files will be periodically updated based on the commit logs.
|
||||
|
||||
<p>Code that you contribute should use the standard copyright header:</p>
|
||||
|
||||
<pre>
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Files in the repository are copyright the year they are added. It is not
|
||||
necessary to update the copyright year on files that you change.
|
||||
</p>
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
}-->
|
||||
|
||||
<p><i>
|
||||
This applies to the standard toolchain (the <code>gc</code> Go
|
||||
compiler and tools). Gccgo has native gdb support.
|
||||
This applies to the <code>gc</code> toolchain. Gccgo has native gdb support.
|
||||
Besides this overview you might want to consult the
|
||||
<a href="http://sourceware.org/gdb/current/onlinedocs/gdb/">GDB manual</a>.
|
||||
</i></p>
|
||||
@@ -50,14 +49,6 @@ when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
|
||||
debugged.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you want to use gdb to inspect a core dump, you can trigger a dump
|
||||
on a program crash, on systems that permit it, by setting
|
||||
<code>GOTRACEBACK=crash</code> in the environment (see the
|
||||
<a href="/pkg/runtime/#hdr-Environment_Variables"> runtime package
|
||||
documentation</a> for more info).
|
||||
</p>
|
||||
|
||||
<h3 id="Common_Operations">Common Operations</h3>
|
||||
|
||||
<ul>
|
||||
@@ -139,7 +130,7 @@ the DWARF code.
|
||||
|
||||
<p>
|
||||
If you're interested in what the debugging information looks like, run
|
||||
'<code>objdump -W a.out</code>' and browse through the <code>.debug_*</code>
|
||||
'<code>objdump -W 6.out</code>' and browse through the <code>.debug_*</code>
|
||||
sections.
|
||||
</p>
|
||||
|
||||
@@ -386,9 +377,7 @@ $3 = struct hchan<*testing.T>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That <code>struct hchan<*testing.T></code> is the
|
||||
runtime-internal representation of a channel. It is currently empty,
|
||||
or gdb would have pretty-printed its contents.
|
||||
That <code>struct hchan<*testing.T></code> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -15,139 +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.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.9.3 (released 2018/01/22) includes fixes to the compiler, runtime,
|
||||
and the <code>database/sql</code>, <code>math/big</code>, <code>net/http</code>,
|
||||
and <code>net/url</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.3">Go
|
||||
1.9.3 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.9.4 (released 2018/02/07) includes a security fix to “go get”.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.4">Go
|
||||
1.9.4</a> milestone on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and
|
||||
<code>net/http/pprof</code> package.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.5">Go
|
||||
1.9.5 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.9.6 (released 2018/05/01) includes fixes to the compiler and go command.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.6">Go
|
||||
1.9.6 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.9.7 (released 2018/06/05) includes fixes to the go command, and the
|
||||
<code>crypto/x509</code>, and <code>strings</code> packages.
|
||||
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
|
||||
minimal support to the go command for the vgo transition</a>.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.7">Go
|
||||
1.9.7 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
|
||||
|
||||
<p>
|
||||
Go 1.8 is a major release of Go.
|
||||
Read the <a href="/doc/go1.8">Go 1.8 Release Notes</a> for more information.
|
||||
</p>
|
||||
|
||||
<h3 id="go1.8.minor">Minor revisions</h3>
|
||||
|
||||
<p>
|
||||
go1.8.1 (released 2017/04/07) includes fixes to the compiler, linker, runtime,
|
||||
documentation, <code>go</code> command and the <code>crypto/tls</code>,
|
||||
<code>encoding/xml</code>, <code>image/png</code>, <code>net</code>,
|
||||
<code>net/http</code>, <code>reflect</code>, <code>text/template</code>,
|
||||
and <code>time</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.1">Go
|
||||
1.8.1 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.8.2 (released 2017/05/23) includes a security fix to the
|
||||
<code>crypto/elliptic</code> package.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
|
||||
1.8.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.8.3 (released 2017/05/24) includes fixes to the compiler, runtime,
|
||||
documentation, and the <code>database/sql</code> package.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.3">Go
|
||||
1.8.3 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
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>
|
||||
|
||||
<p>
|
||||
go1.8.5 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
|
||||
documentation, <code>go</code> command,
|
||||
and the <code>crypto/x509</code> and <code>net/smtp</code> packages.
|
||||
It includes a fix to a bug introduced in Go 1.8.4 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.8.5">Go
|
||||
1.8.5 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.8.6 (released 2018/01/22) includes the the same fix in <code>math/big</code>
|
||||
as Go 1.9.3 and was released at the same time.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.6">Go
|
||||
1.8.6 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.8.7 (released 2018/02/07) includes a security fix to “go get”.
|
||||
It contains the same fix as Go 1.9.4 and was released at the same time.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.7">Go
|
||||
1.8.7</a> milestone 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.7">go1.7 (released 2016/08/15)</h2>
|
||||
@@ -189,20 +69,6 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
|
||||
1.7.4 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.7.5 (released 2017/01/26) includes fixes to the compiler, runtime,
|
||||
and the <code>crypto/x509</code> and <code>time</code> packages.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.5">Go
|
||||
1.7.5 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.7.6 (released 2017/05/23) includes the same security fix as Go 1.8.2 and
|
||||
was released at the same time.
|
||||
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
|
||||
1.8.2 milestone</a> on our issue tracker for details.
|
||||
</p>
|
||||
|
||||
<h2 id="go1.6">go1.6 (released 2016/02/17)</h2>
|
||||
|
||||
<p>
|
||||
@@ -323,7 +189,7 @@ See the <a href="https://github.com/golang/go/commits/go1.3.2">change history</a
|
||||
</p>
|
||||
|
||||
<p>
|
||||
go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
|
||||
go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
|
||||
See the <a href="https://github.com/golang/go/commits/go1.3.3">change history</a> for details.
|
||||
</p>
|
||||
|
||||
@@ -387,7 +253,7 @@ about the future of Go 1.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The go1 release corresponds to
|
||||
The go1 release corresponds to
|
||||
<code><a href="weekly.html#2012-03-27">weekly.2012-03-27</a></code>.
|
||||
</p>
|
||||
|
||||
@@ -403,7 +269,7 @@ It also includes several minor code and documentation fixes.
|
||||
|
||||
<p>
|
||||
go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
|
||||
of maps using struct or array keys:
|
||||
of maps using struct or array keys:
|
||||
<a href="//golang.org/issue/3695">issue 3695</a> and
|
||||
<a href="//golang.org/issue/3573">issue 3573</a>.
|
||||
It also includes many minor code and documentation fixes.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<!--{
|
||||
"Title": "Documentation",
|
||||
"Path": "/doc/",
|
||||
"Template": true
|
||||
"Path": "/doc/"
|
||||
}-->
|
||||
|
||||
<p>
|
||||
@@ -34,20 +33,14 @@ libraries.
|
||||
|
||||
<img class="gopher" src="/doc/gopher/doc.png"/>
|
||||
|
||||
<h3 id="go_tour">
|
||||
{{if $.GoogleCN}}
|
||||
A Tour of Go
|
||||
{{else}}
|
||||
<a href="//tour.golang.org/">A Tour of Go</a>
|
||||
{{end}}
|
||||
</h3>
|
||||
<h3 id="go_tour"><a href="//tour.golang.org/">A Tour of Go</a></h3>
|
||||
<p>
|
||||
An interactive introduction to Go in three sections.
|
||||
The first section covers basic syntax and data structures; the second discusses
|
||||
methods and interfaces; and the third introduces Go's concurrency primitives.
|
||||
Each section concludes with a few exercises so you can practice what you've
|
||||
learned. You can {{if not $.GoogleCN}}<a href="//tour.golang.org/">take the tour
|
||||
online</a> or{{end}} install it locally with:
|
||||
learned. You can <a href="//tour.golang.org/">take the tour online</a> or
|
||||
install it locally with:
|
||||
</p>
|
||||
<p>
|
||||
<pre>
|
||||
@@ -58,19 +51,10 @@ This will place the <code>gotour</code> binary in your workspace's <code>bin</co
|
||||
|
||||
<h3 id="code"><a href="code.html">How to write Go code</a></h3>
|
||||
<p>
|
||||
{{if not $.GoogleCN}}
|
||||
Also available as a <a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this
|
||||
{{else}}
|
||||
This
|
||||
{{end}}
|
||||
doc 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.
|
||||
Also available as a
|
||||
<a href="//www.youtube.com/watch?v=XCsL89YtqCs">screencast</a>, this doc
|
||||
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="effective_go"><a href="effective_go.html">Effective Go</a></h3>
|
||||
@@ -125,11 +109,9 @@ same variable in a different goroutine.
|
||||
|
||||
<h2 id="articles">Articles</h2>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h3 id="blog"><a href="//blog.golang.org/">The Go Blog</a></h3>
|
||||
<p>The official blog of the Go project, featuring news and in-depth articles by
|
||||
the Go team and guests.</p>
|
||||
{{end}}
|
||||
|
||||
<h4>Codewalks</h4>
|
||||
<p>
|
||||
@@ -142,7 +124,6 @@ Guided tours of Go programs.
|
||||
<li><a href="/doc/articles/wiki/">Writing Web Applications</a> - building a simple web application.</li>
|
||||
</ul>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h4>Language</h4>
|
||||
<ul>
|
||||
<li><a href="/blog/json-rpc-tale-of-interfaces">JSON-RPC: a tale of interfaces</a></li>
|
||||
@@ -163,20 +144,17 @@ Guided tours of Go programs.
|
||||
<li><a href="/blog/go-image-package">The Go image package</a> - the fundamentals of the <a href="/pkg/image/">image</a> package.</li>
|
||||
<li><a href="/blog/go-imagedraw-package">The Go image/draw package</a> - the fundamentals of the <a href="/pkg/image/draw/">image/draw</a> package.</li>
|
||||
</ul>
|
||||
{{end}}
|
||||
|
||||
<h4>Tools</h4>
|
||||
<ul>
|
||||
<li><a href="/doc/articles/go_command.html">About the Go command</a> - why we wrote it, what it is, what it's not, and how to use it.</li>
|
||||
<li><a href="/doc/gdb">Debugging Go Code with GDB</a></li>
|
||||
<li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - a manual for the data race detector.</li>
|
||||
<li><a href="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li>
|
||||
{{if not $.GoogleCN}}
|
||||
<li><a href="/blog/c-go-cgo">C? Go? Cgo!</a> - linking against C code with <a href="/cmd/cgo/">cgo</a>.</li>
|
||||
<li><a href="/doc/gdb">Debugging Go Code with GDB</a></li>
|
||||
<li><a href="/blog/godoc-documenting-go-code">Godoc: documenting Go code</a> - writing good documentation for <a href="/cmd/godoc/">godoc</a>.</li>
|
||||
<li><a href="/blog/profiling-go-programs">Profiling Go Programs</a></li>
|
||||
<li><a href="/doc/articles/race_detector.html">Data Race Detector</a> - a manual for the data race detector.</li>
|
||||
<li><a href="/blog/race-detector">Introducing the Go Race Detector</a> - an introduction to the race detector.</li>
|
||||
{{end}}
|
||||
<li><a href="/doc/asm">A Quick Guide to Go's Assembler</a> - an introduction to the assembler used by Go.</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="articles_more">More</h4>
|
||||
@@ -185,7 +163,7 @@ See the <a href="/wiki/Articles">Articles page</a> at the
|
||||
<a href="/wiki">Wiki</a> for more Go articles.
|
||||
</p>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
|
||||
<h2 id="talks">Talks</h2>
|
||||
|
||||
<img class="gopher" src="/doc/gopher/talks.png"/>
|
||||
@@ -216,7 +194,7 @@ This talk expands on the <i>Go Concurrency Patterns</i> talk to dive deeper into
|
||||
<p>
|
||||
See the <a href="/talks">Go Talks site</a> and <a href="/wiki/GoTalks">wiki page</a> for more Go talks.
|
||||
</p>
|
||||
{{end}}
|
||||
|
||||
|
||||
<h2 id="nonenglish">Non-English Documentation</h2>
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -52,19 +52,6 @@ user libraries. The Go 1.4 runtime is not fully merged, but that
|
||||
should not be visible to Go programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 6 releases include a complete implementation of the Go 1.6.1
|
||||
user libraries. The Go 1.6 runtime is not fully merged, but that
|
||||
should not be visible to Go programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GCC 7 releases are expected to include a complete implementation
|
||||
of the Go 1.8 user libraries. As with earlier releases, the Go 1.8
|
||||
runtime is not fully merged, but that should not be visible to Go
|
||||
programs.
|
||||
</p>
|
||||
|
||||
<h2 id="Source_code">Source code</h2>
|
||||
|
||||
<p>
|
||||
@@ -173,6 +160,23 @@ make
|
||||
make install
|
||||
</pre>
|
||||
|
||||
<h3 id="Ubuntu">A note on Ubuntu</h3>
|
||||
|
||||
<p>
|
||||
Current versions of Ubuntu and versions of GCC before 4.8 disagree on
|
||||
where system libraries and header files are found. This is not a
|
||||
gccgo issue. When building older versions of GCC, setting these
|
||||
environment variables while configuring and building gccgo may fix the
|
||||
problem.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
|
||||
C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
|
||||
CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
|
||||
export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
|
||||
</pre>
|
||||
|
||||
<h2 id="Using_gccgo">Using gccgo</h2>
|
||||
|
||||
<p>
|
||||
@@ -360,15 +364,12 @@ or with C++ code compiled using <code>extern "C"</code>.
|
||||
<h3 id="Types">Types</h3>
|
||||
|
||||
<p>
|
||||
Basic types map directly: an <code>int32</code> in Go is
|
||||
an <code>int32_t</code> in C, an <code>int64</code> is
|
||||
an <code>int64_t</code>, etc.
|
||||
The Go type <code>int</code> is an integer that is the same size as a
|
||||
pointer, and as such corresponds to the C type <code>intptr_t</code>.
|
||||
Go <code>byte</code> is equivalent to C <code>unsigned char</code>.
|
||||
Pointers in Go are pointers in C.
|
||||
A Go <code>struct</code> is the same as C <code>struct</code> with the
|
||||
same fields and types.
|
||||
Basic types map directly: an <code>int</code> in Go is an <code>int</code>
|
||||
in C, an <code>int32</code> is an <code>int32_t</code>,
|
||||
etc. Go <code>byte</code> is equivalent to C <code>unsigned
|
||||
char</code>.
|
||||
Pointers in Go are pointers in C. A Go <code>struct</code> is the same as C
|
||||
<code>struct</code> with the same fields and types.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -379,7 +380,7 @@ structure (this is <b style="color: red;">subject to change</b>):
|
||||
<pre>
|
||||
struct __go_string {
|
||||
const unsigned char *__data;
|
||||
intptr_t __length;
|
||||
int __length;
|
||||
};
|
||||
</pre>
|
||||
|
||||
@@ -399,8 +400,8 @@ A slice in Go is a structure. The current definition is
|
||||
<pre>
|
||||
struct __go_slice {
|
||||
void *__values;
|
||||
intptr_t __count;
|
||||
intptr_t __capacity;
|
||||
int __count;
|
||||
int __capacity;
|
||||
};
|
||||
</pre>
|
||||
|
||||
@@ -525,3 +526,15 @@ This procedure is full of unstated caveats and restrictions and we make no
|
||||
guarantee that it will not change in the future. It is more useful as a
|
||||
starting point for real Go code than as a regular procedure.
|
||||
</p>
|
||||
|
||||
<h2 id="RTEMS_Port">RTEMS Port</h2>
|
||||
<p>
|
||||
The gccgo compiler has been ported to <a href="http://www.rtems.com/">
|
||||
<code>RTEMS</code></a>. <code>RTEMS</code> is a real-time executive
|
||||
that provides a high performance environment for embedded applications
|
||||
on a range of processors and embedded hardware. The current gccgo
|
||||
port is for x86. The goal is to extend the port to most of the
|
||||
<a href="http://www.rtems.org/wiki/index.php/SupportedCPUs">
|
||||
architectures supported by <code>RTEMS</code></a>. For more information on the port,
|
||||
as well as instructions on how to install it, please see this
|
||||
<a href="http://www.rtems.org/wiki/index.php/GCCGoRTEMS"><code>RTEMS</code> Wiki page</a>.
|
||||
|
||||
@@ -15,7 +15,12 @@ Do not send CLs removing the interior tags from such phrases.
|
||||
ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction to Go 1.8</h2>
|
||||
<h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.8</h2>
|
||||
|
||||
<p><strong>
|
||||
Go 1.8 is not yet released. These are work-in-progress
|
||||
release notes. Go 1.8 is expected to be released in February 2017.
|
||||
</strong></p>
|
||||
|
||||
<p>
|
||||
The latest Go release, version 1.8, arrives six months after <a href="go1.7">Go 1.7</a>.
|
||||
@@ -88,8 +93,7 @@ On OpenBSD, Go now requires OpenBSD 5.9 or later. <!-- CL 34093 -->
|
||||
<p>
|
||||
The Plan 9 port's networking support is now much more complete
|
||||
and matches the behavior of Unix and Windows with respect to deadlines
|
||||
and cancelation. For Plan 9 kernel requirements, see the
|
||||
<a href="https://golang.org/wiki/Plan9">Plan 9 wiki page</a>.
|
||||
and cancelation.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -430,11 +434,11 @@ version of gccgo.
|
||||
<h3 id="plugin">Plugins</h3>
|
||||
|
||||
<p>
|
||||
Go now provides early support for plugins with a “<code>plugin</code>”
|
||||
build mode for generating plugins written in Go, and a
|
||||
Go now supports a “<code>plugin</code>” build mode for generating
|
||||
plugins written in Go, and a
|
||||
new <a href="/pkg/plugin/"><code>plugin</code></a> package for
|
||||
loading such plugins at run time. Plugin support is currently only
|
||||
available on Linux. Please report any issues.
|
||||
loading such plugins at run time. Plugin support is only currently
|
||||
available on Linux.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
@@ -794,9 +798,9 @@ Optimizations and minor bug fixes are not listed.
|
||||
hardware support for AES-GCM is present.
|
||||
</p>
|
||||
|
||||
<p> <!-- CL 27315, CL 35290 -->
|
||||
<p> <!-- CL 27315 -->
|
||||
AES-128-CBC cipher suites with SHA-256 are also
|
||||
now supported, but disabled by default.
|
||||
now supported.
|
||||
</p>
|
||||
|
||||
</dd>
|
||||
@@ -804,6 +808,11 @@ Optimizations and minor bug fixes are not listed.
|
||||
|
||||
<dl id="crypto_x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
|
||||
<dd>
|
||||
<p> <!-- CL 30578 -->
|
||||
<a href="/pkg/crypto/x509/#SystemCertPool"><code>SystemCertPool</code></a>
|
||||
is now implemented on Windows.
|
||||
</p>
|
||||
|
||||
<p> <!-- CL 24743 -->
|
||||
PSS signatures are now supported.
|
||||
</p>
|
||||
@@ -854,12 +863,11 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
|
||||
<p>
|
||||
The <a href="/pkg/database/sql#IsolationLevel"><code>IsolationLevel</code></a>
|
||||
can now be set when starting a transaction by setting the isolation level
|
||||
on <a href="/pkg/database/sql#TxOptions.Isolation"><code>TxOptions.Isolation</code></a> and passing
|
||||
it to <a href="/pkg/database/sql#DB.BeginTx"><code>DB.BeginTx</code></a>.
|
||||
on the <code>Context</code> then passing that <code>Context</code> to
|
||||
<a href="/pkg/database/sql#DB.BeginContext"><code>DB.BeginContext</code></a>.
|
||||
An error will be returned if an isolation level is selected that the driver
|
||||
does not support. A read-only attribute may also be set on the transaction
|
||||
by setting <a href="/pkg/database/sql/#TxOptions.ReadOnly"><code>TxOptions.ReadOnly</code></a>
|
||||
to true.
|
||||
with <a href="/pkg/database/sql/#ReadOnlyContext"><code>ReadOnlyContext</code></a>.
|
||||
</p>
|
||||
<p>
|
||||
Queries now expose the SQL column type information for drivers that support it.
|
||||
@@ -1304,7 +1312,7 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
|
||||
request must have the new
|
||||
<a href="/pkg/net/http/#Request"><code>Request.GetBody</code></a>
|
||||
field defined.
|
||||
<a href="/pkg/net/http/#NewRequest"><code>NewRequest</code></a>
|
||||
<a href="pkg/net/http/#NewRequest"><code>NewRequest</code></a>
|
||||
sets <code>Request.GetBody</code> automatically for common
|
||||
body types.
|
||||
</li>
|
||||
@@ -1609,9 +1617,9 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
|
||||
June 31 and July 32.
|
||||
</p>
|
||||
|
||||
<p> <!-- CL 33029 --> <!-- CL 34816 -->
|
||||
<p> <!-- CL 33029 -->
|
||||
The <code>tzdata</code> database has been updated to version
|
||||
2016j for systems that don't already have a local time zone
|
||||
2016i for systems that don't already have a local time zone
|
||||
database.
|
||||
</p>
|
||||
|
||||
@@ -1641,17 +1649,6 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
|
||||
and only the overall execution of the test binary would fail.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 32455 -->
|
||||
The signature of the
|
||||
<a href="/pkg/testing/#MainStart"><code>MainStart</code></a>
|
||||
function has changed, as allowed by the documentation. It is an
|
||||
internal detail and not part of the Go 1 compatibility promise.
|
||||
If you're not calling <code>MainStart</code> directly but see
|
||||
errors, that likely means you set the
|
||||
normally-empty <code>GOROOT</code> environment variable and it
|
||||
doesn't match the version of your <code>go</code> command's binary.
|
||||
</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
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
@@ -775,7 +775,7 @@ to turn a string into an error. It replaces the old <code>os.NewError</code>.
|
||||
</p>
|
||||
|
||||
{{code "/doc/progs/go1.go" `/ErrSyntax/`}}
|
||||
|
||||
|
||||
<p>
|
||||
<em>Updating</em>:
|
||||
Running <code>go</code> <code>fix</code> will update almost all code affected by the change.
|
||||
@@ -1827,7 +1827,7 @@ for full details.
|
||||
<tr><td>Uitob(x, b)</td> <td>FormatUint(uint64(x), b)</td></tr>
|
||||
<tr><td>Uitob64(x, b)</td> <td>FormatUint(x, b)</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<p>
|
||||
<em>Updating</em>:
|
||||
Running <code>go</code> <code>fix</code> will update almost all code affected by the change.
|
||||
@@ -1841,7 +1841,7 @@ a cast that must be added by hand; the <code>go</code> <code>fix</code> tool wil
|
||||
<h3 id="templates">The template packages</h3>
|
||||
|
||||
<p>
|
||||
The <code>template</code> and <code>exp/template/html</code> packages have moved to
|
||||
The <code>template</code> and <code>exp/template/html</code> packages have moved to
|
||||
<a href="/pkg/text/template/"><code>text/template</code></a> and
|
||||
<a href="/pkg/html/template/"><code>html/template</code></a>.
|
||||
More significant, the interface to these packages has been simplified.
|
||||
@@ -2035,4 +2035,4 @@ They are available for many combinations of architecture and operating system
|
||||
Installation details are described on the
|
||||
<a href="/doc/install">Getting Started</a> page, while
|
||||
the distributions themselves are listed on the
|
||||
<a href="/dl/">downloads page</a>.
|
||||
<a href="https://golang.org/dl/">downloads page</a>.
|
||||
|
||||
@@ -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">
|
||||
|
||||
284
doc/go_spec.html
284
doc/go_spec.html
@@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of June 28, 2017",
|
||||
"Subtitle": "Version of November 18, 2016",
|
||||
"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>
|
||||
@@ -745,7 +738,7 @@ The method set of any other type <code>T</code> consists of all
|
||||
The method set of the corresponding <a href="#Pointer_types">pointer type</a> <code>*T</code>
|
||||
is the set of all methods declared with receiver <code>*T</code> or <code>T</code>
|
||||
(that is, it also contains the method set of <code>T</code>).
|
||||
Further rules apply to structs containing embedded fields, as described
|
||||
Further rules apply to structs containing anonymous fields, as described
|
||||
in the section on <a href="#Struct_types">struct types</a>.
|
||||
Any other type has an empty method set.
|
||||
In a method set, each method must have a
|
||||
@@ -954,16 +947,16 @@ Moreover, the inner slices must be initialized individually.
|
||||
<p>
|
||||
A struct is a sequence of named elements, called fields, each of which has a
|
||||
name and a type. Field names may be specified explicitly (IdentifierList) or
|
||||
implicitly (EmbeddedField).
|
||||
implicitly (AnonymousField).
|
||||
Within a struct, non-<a href="#Blank_identifier">blank</a> field names must
|
||||
be <a href="#Uniqueness_of_identifiers">unique</a>.
|
||||
</p>
|
||||
|
||||
<pre class="ebnf">
|
||||
StructType = "struct" "{" { FieldDecl ";" } "}" .
|
||||
FieldDecl = (IdentifierList Type | EmbeddedField) [ Tag ] .
|
||||
EmbeddedField = [ "*" ] TypeName .
|
||||
Tag = string_lit .
|
||||
StructType = "struct" "{" { FieldDecl ";" } "}" .
|
||||
FieldDecl = (IdentifierList Type | AnonymousField) [ Tag ] .
|
||||
AnonymousField = [ "*" ] TypeName .
|
||||
Tag = string_lit .
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
@@ -981,15 +974,16 @@ struct {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A field declared with a type but no explicit field name is called an <i>embedded field</i>.
|
||||
An embedded field must be specified as
|
||||
A field declared with a type but no explicit field name is an <i>anonymous field</i>,
|
||||
also called an <i>embedded</i> field or an embedding of the type in the struct.
|
||||
An embedded type must be specified as
|
||||
a type name <code>T</code> or as a pointer to a non-interface type name <code>*T</code>,
|
||||
and <code>T</code> itself may not be
|
||||
a pointer type. The unqualified type name acts as the field name.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
// A struct with four embedded fields of types T1, *T2, P.T3 and *P.T4
|
||||
// A struct with four anonymous fields of type T1, *T2, P.T3 and *P.T4
|
||||
struct {
|
||||
T1 // field name is T1
|
||||
*T2 // field name is T2
|
||||
@@ -1006,15 +1000,15 @@ in a struct type:
|
||||
|
||||
<pre>
|
||||
struct {
|
||||
T // conflicts with embedded field *T and *P.T
|
||||
*T // conflicts with embedded field T and *P.T
|
||||
*P.T // conflicts with embedded field T and *T
|
||||
T // conflicts with anonymous field *T and *P.T
|
||||
*T // conflicts with anonymous field T and *P.T
|
||||
*P.T // conflicts with anonymous field T and *T
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A field or <a href="#Method_declarations">method</a> <code>f</code> of an
|
||||
embedded field in a struct <code>x</code> is called <i>promoted</i> if
|
||||
anonymous field in a struct <code>x</code> is called <i>promoted</i> if
|
||||
<code>x.f</code> is a legal <a href="#Selectors">selector</a> that denotes
|
||||
that field or method <code>f</code>.
|
||||
</p>
|
||||
@@ -1031,7 +1025,7 @@ promoted methods are included in the method set of the struct as follows:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
If <code>S</code> contains an embedded field <code>T</code>,
|
||||
If <code>S</code> contains an anonymous field <code>T</code>,
|
||||
the <a href="#Method_sets">method sets</a> of <code>S</code>
|
||||
and <code>*S</code> both include promoted methods with receiver
|
||||
<code>T</code>. The method set of <code>*S</code> also
|
||||
@@ -1039,7 +1033,7 @@ promoted methods are included in the method set of the struct as follows:
|
||||
</li>
|
||||
|
||||
<li>
|
||||
If <code>S</code> contains an embedded field <code>*T</code>,
|
||||
If <code>S</code> contains an anonymous field <code>*T</code>,
|
||||
the method sets of <code>S</code> and <code>*S</code> both
|
||||
include promoted methods with receiver <code>T</code> or
|
||||
<code>*T</code>.
|
||||
@@ -1424,10 +1418,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>
|
||||
@@ -1439,8 +1434,8 @@ components have identical types. In detail:
|
||||
<li>Two struct types are identical if they have the same sequence of fields,
|
||||
and if corresponding fields have the same names, and identical types,
|
||||
and identical tags.
|
||||
<a href="#Exported_identifiers">Non-exported</a> field names from different
|
||||
packages are always different.</li>
|
||||
Two anonymous fields are considered to have the same name. Lower-case field
|
||||
names from different packages are always different.</li>
|
||||
|
||||
<li>Two pointer types are identical if they have identical base types.</li>
|
||||
|
||||
@@ -1450,9 +1445,8 @@ components have identical types. In detail:
|
||||
Parameter and result names are not required to match.</li>
|
||||
|
||||
<li>Two interface types are identical if they have the same set of methods
|
||||
with the same names and identical function types.
|
||||
<a href="#Exported_identifiers">Non-exported</a> method names from different
|
||||
packages are always different. The order of the methods is irrelevant.</li>
|
||||
with the same names and identical function types. Lower-case method names from
|
||||
different packages are always different. The order of the methods is irrelevant.</li>
|
||||
|
||||
<li>Two map types are identical if they have identical key and value types.</li>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1951,7 +1891,7 @@ type NewMutex Mutex
|
||||
type PtrMutex *Mutex
|
||||
|
||||
// The method set of *PrintableMutex contains the methods
|
||||
// Lock and Unlock bound to its embedded field Mutex.
|
||||
// Lock and Unlock bound to its anonymous field Mutex.
|
||||
type PrintableMutex struct {
|
||||
Mutex
|
||||
}
|
||||
@@ -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>
|
||||
@@ -2553,13 +2492,13 @@ If <code>x</code> is a package name, see the section on
|
||||
A selector <code>f</code> may denote a field or method <code>f</code> of
|
||||
a type <code>T</code>, or it may refer
|
||||
to a field or method <code>f</code> of a nested
|
||||
<a href="#Struct_types">embedded field</a> of <code>T</code>.
|
||||
The number of embedded fields traversed
|
||||
<a href="#Struct_types">anonymous field</a> of <code>T</code>.
|
||||
The number of anonymous fields traversed
|
||||
to reach <code>f</code> is called its <i>depth</i> in <code>T</code>.
|
||||
The depth of a field or method <code>f</code>
|
||||
declared in <code>T</code> is zero.
|
||||
The depth of a field or method <code>f</code> declared in
|
||||
an embedded field <code>A</code> in <code>T</code> is the
|
||||
an anonymous field <code>A</code> in <code>T</code> is the
|
||||
depth of <code>f</code> in <code>A</code> plus one.
|
||||
</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>
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<!--{
|
||||
"Title": "Help",
|
||||
"Path": "/help/",
|
||||
"Template": true
|
||||
"Path": "/help/"
|
||||
}-->
|
||||
|
||||
<div id="manual-nav"></div>
|
||||
@@ -10,7 +9,6 @@
|
||||
|
||||
<img class="gopher" src="/doc/gopher/help.png"/>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h3 id="mailinglist"><a href="https://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
|
||||
<p>
|
||||
Get help from Go users, and share your work on the official mailing list.
|
||||
@@ -33,12 +31,10 @@ forum for Go programmers.
|
||||
<h3 id="irc"><a href="irc:irc.freenode.net/go-nuts">Go IRC Channel</a></h3>
|
||||
<p>Get live support at <b>#go-nuts</b> on <b>irc.freenode.net</b>, the official
|
||||
Go IRC channel.</p>
|
||||
{{end}}
|
||||
|
||||
<h3 id="faq"><a href="/doc/faq">Frequently Asked Questions (FAQ)</a></h3>
|
||||
<p>Answers to common questions about Go.</p>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h2 id="inform">Stay informed</h2>
|
||||
|
||||
<h3 id="announce"><a href="https://groups.google.com/group/golang-announce">Go Announcements Mailing List</a></h3>
|
||||
@@ -63,13 +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>
|
||||
{{end}}
|
||||
|
||||
<h2 id="community">Community resources</h2>
|
||||
|
||||
<h3 id="go_user_groups"><a href="/wiki/GoUserGroups">Go User Groups</a></h3>
|
||||
@@ -78,13 +67,11 @@ Each month in places around the world, groups of Go programmers ("gophers")
|
||||
meet to talk about Go. Find a chapter near you.
|
||||
</p>
|
||||
|
||||
{{if not $.GoogleCN}}
|
||||
<h3 id="playground"><a href="/play">Go Playground</a></h3>
|
||||
<p>A place to write, run, and share Go code.</p>
|
||||
|
||||
<h3 id="wiki"><a href="/wiki">Go Wiki</a></h3>
|
||||
<p>A wiki maintained by the Go community.</p>
|
||||
{{end}}
|
||||
|
||||
<h3 id="conduct"><a href="/conduct">Code of Conduct</a></h3>
|
||||
<p>
|
||||
|
||||
@@ -143,13 +143,10 @@ 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.)
|
||||
After unpacking the Go 1.4 source, <code>cd</code> to
|
||||
the <code>src</code> subdirectory and run <code>make.bash</code> (or,
|
||||
on Windows, <code>make.bat</code>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -221,7 +218,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.7.4</code>, for example):</p>
|
||||
|
||||
<pre>
|
||||
$ git clone https://go.googlesource.com/go
|
||||
@@ -409,7 +406,7 @@ New releases are announced on the
|
||||
<a href="//groups.google.com/group/golang-announce">golang-announce</a>
|
||||
mailing list.
|
||||
Each announcement mentions the latest release tag, for instance,
|
||||
<code class="versionTag">go1.9</code>.
|
||||
<code class="versionTag">go1.7.4</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
<h2 id="download">Download the Go distribution</h2>
|
||||
|
||||
<p>
|
||||
<a href="/dl/" id="start" class="download">
|
||||
<a href="https://golang.org/dl/" id="start" class="download">
|
||||
<span class="big">Download Go</span>
|
||||
<span class="desc">Click here to visit the downloads page</span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="/dl/" target="_blank">Official binary
|
||||
<a href="https://golang.org/dl/" target="_blank">Official binary
|
||||
distributions</a> are available for the FreeBSD (release 8-STABLE and above),
|
||||
Linux, Mac OS X (10.8 and above), and Windows operating systems and
|
||||
the 32-bit (<code>386</code>) and 64-bit (<code>amd64</code>) x86 processor
|
||||
@@ -33,7 +33,7 @@ system and architecture, try
|
||||
<h2 id="requirements">System requirements</h2>
|
||||
|
||||
<p>
|
||||
Go <a href="/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>
|
||||
@@ -77,7 +77,7 @@ first <a href="#uninstall">remove the existing version</a>.
|
||||
<h3 id="tarball">Linux, Mac OS X, and FreeBSD tarballs</h3>
|
||||
|
||||
<p>
|
||||
<a href="/dl/">Download the archive</a>
|
||||
<a href="https://golang.org/dl/">Download the archive</a>
|
||||
and extract it into <code>/usr/local</code>, creating a Go tree in
|
||||
<code>/usr/local/go</code>. For example:
|
||||
</p>
|
||||
@@ -138,7 +138,7 @@ location.
|
||||
<h3 id="osx">Mac OS X package installer</h3>
|
||||
|
||||
<p>
|
||||
<a href="/dl/">Download the package file</a>,
|
||||
<a href="https://golang.org/dl/">Download the package file</a>,
|
||||
open it, and follow the prompts to install the Go tools.
|
||||
The package installs the Go distribution to <code>/usr/local/go</code>.
|
||||
</p>
|
||||
@@ -167,7 +167,7 @@ MSI installer that configures your installation automatically.
|
||||
<h4 id="windows_msi">MSI installer</h4>
|
||||
|
||||
<p>
|
||||
Open the <a href="/dl/">MSI file</a>
|
||||
Open the <a href="https://golang.org/dl/">MSI file</a>
|
||||
and follow the prompts to install the Go tools.
|
||||
By default, the installer puts the Go distribution in <code>c:\Go</code>.
|
||||
</p>
|
||||
@@ -185,7 +185,7 @@ command prompts for the change to take effect.
|
||||
<h4 id="windows_zip">Zip archive</h4>
|
||||
|
||||
<p>
|
||||
<a href="/dl/">Download the zip file</a> and extract it into the directory of your choice (we suggest <code>c:\Go</code>).
|
||||
<a href="https://golang.org/dl/">Download the zip file</a> and extract it into the directory of your choice (we suggest <code>c:\Go</code>).
|
||||
</p>
|
||||
|
||||
<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>
|
||||
@@ -249,7 +250,7 @@ $ <b>cd $HOME/go/src/hello</b>
|
||||
$ <b>go build</b>
|
||||
</pre>
|
||||
|
||||
<pre class="testWindows">
|
||||
<pre class="testWindows" style="display: none">
|
||||
C:\> <b>cd %USERPROFILE%\go\src\hello</b>
|
||||
C:\Users\Gopher\go\src\hello> <b>go build</b>
|
||||
</pre>
|
||||
@@ -266,7 +267,7 @@ $ <b>./hello</b>
|
||||
hello, world
|
||||
</pre>
|
||||
|
||||
<pre class="testWindows">
|
||||
<pre class="testWindows" style="display: none">
|
||||
C:\Users\Gopher\go\src\hello> <b>hello</b>
|
||||
hello, world
|
||||
</pre>
|
||||
|
||||
146
doc/root.html
146
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>
|
||||
@@ -58,7 +56,7 @@ simple, reliable, and efficient software.
|
||||
|
||||
<div id="gopher"></div>
|
||||
|
||||
<a href="/dl/" id="start">
|
||||
<a href="https://golang.org/dl/" id="start">
|
||||
<span class="big">Download Go</span>
|
||||
<span class="desc">
|
||||
Binary distributions available for<br>
|
||||
@@ -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 {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -L/nonexist
|
||||
#cgo LDFLAGS: -c
|
||||
|
||||
void test() {
|
||||
xxx; // ERROR HERE
|
||||
|
||||
@@ -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) }
|
||||
|
||||
@@ -73,7 +73,7 @@ func test18146(t *testing.T) {
|
||||
}
|
||||
runtime.GOMAXPROCS(threads)
|
||||
argv := append(os.Args, "-test.run=NoSuchTestExists")
|
||||
if err := syscall.Exec(os.Args[0], argv, os.Environ()); err != nil {
|
||||
if err := syscall.Exec(os.Args[0], argv, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -17,7 +17,7 @@ package cgotest
|
||||
static stack_t oss;
|
||||
static char signalStack[SIGSTKSZ];
|
||||
|
||||
static void changeSignalStack(void) {
|
||||
static void changeSignalStack() {
|
||||
stack_t ss;
|
||||
memset(&ss, 0, sizeof ss);
|
||||
ss.ss_sp = signalStack;
|
||||
@@ -29,7 +29,7 @@ static void changeSignalStack(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static void restoreSignalStack(void) {
|
||||
static void restoreSignalStack() {
|
||||
#if (defined(__x86_64__) || defined(__i386__)) && defined(__APPLE__)
|
||||
// The Darwin C library enforces a minimum that the kernel does not.
|
||||
// This is OK since we allocated this much space in mpreinit,
|
||||
@@ -42,7 +42,7 @@ static void restoreSignalStack(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static int zero(void) {
|
||||
static int zero() {
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define fd (30)
|
||||
#define fd (100)
|
||||
|
||||
// Tests libgo2.so, which does not export any functions.
|
||||
// Read a string from the file descriptor and print it.
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
// that the C code can also use.
|
||||
|
||||
const (
|
||||
fd = 30
|
||||
fd = 100
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -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)
|
||||
@@ -179,13 +179,6 @@ if test "$output" != "PASS"; then
|
||||
status=1
|
||||
fi
|
||||
|
||||
if test "$libext" = "dylib"; then
|
||||
# make sure dylibs are well-formed
|
||||
if ! otool -l libgo*.dylib >/dev/null; then
|
||||
status=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $status = 0; then
|
||||
echo "ok"
|
||||
fi
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"iface_i"
|
||||
"log"
|
||||
"plugin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
a, err := plugin.Open("iface_a.so")
|
||||
if err != nil {
|
||||
log.Fatalf(`plugin.Open("iface_a.so"): %v`, err)
|
||||
}
|
||||
b, err := plugin.Open("iface_b.so")
|
||||
if err != nil {
|
||||
log.Fatalf(`plugin.Open("iface_b.so"): %v`, err)
|
||||
}
|
||||
|
||||
af, err := a.Lookup("F")
|
||||
if err != nil {
|
||||
log.Fatalf(`a.Lookup("F") failed: %v`, err)
|
||||
}
|
||||
bf, err := b.Lookup("F")
|
||||
if err != nil {
|
||||
log.Fatalf(`b.Lookup("F") failed: %v`, err)
|
||||
}
|
||||
if af.(func() interface{})() != bf.(func() interface{})() {
|
||||
panic("empty interfaces not equal")
|
||||
}
|
||||
|
||||
ag, err := a.Lookup("G")
|
||||
if err != nil {
|
||||
log.Fatalf(`a.Lookup("G") failed: %v`, err)
|
||||
}
|
||||
bg, err := b.Lookup("G")
|
||||
if err != nil {
|
||||
log.Fatalf(`b.Lookup("G") failed: %v`, err)
|
||||
}
|
||||
if ag.(func() iface_i.I)() != bg.(func() iface_i.I)() {
|
||||
panic("nonempty interfaces not equal")
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import "iface_i"
|
||||
|
||||
//go:noinline
|
||||
func F() interface{} {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func G() iface_i.I {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import "iface_i"
|
||||
|
||||
//go:noinline
|
||||
func F() interface{} {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func G() iface_i.I {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package iface_i
|
||||
|
||||
type I interface {
|
||||
M()
|
||||
}
|
||||
|
||||
type T struct {
|
||||
}
|
||||
|
||||
func (t *T) M() {
|
||||
}
|
||||
|
||||
// *T implements I
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package dynamodbstreamsevt
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
var foo json.RawMessage
|
||||
|
||||
type Event struct{}
|
||||
|
||||
func (e *Event) Dummy() {}
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// The bug happened like this:
|
||||
// 1) The main binary adds an itab for *json.UnsupportedValueError / error
|
||||
// (concrete type / interface type). This itab goes in hash bucket 0x111.
|
||||
// 2) The plugin adds that same itab again. That makes a cycle in the itab
|
||||
// chain rooted at hash bucket 0x111.
|
||||
// 3) The main binary then asks for the itab for *dynamodbstreamsevt.Event /
|
||||
// json.Unmarshaler. This itab happens to also live in bucket 0x111.
|
||||
// The lookup code goes into an infinite loop searching for this itab.
|
||||
// The code is carefully crafted so that the two itabs are both from the
|
||||
// same bucket, and so that the second itab doesn't exist in
|
||||
// the itab hashmap yet (so the entire linked list must be searched).
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"issue18676/dynamodbstreamsevt"
|
||||
"plugin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
plugin.Open("plugin.so")
|
||||
|
||||
var x interface{} = (*dynamodbstreamsevt.Event)(nil)
|
||||
if _, ok := x.(json.Unmarshaler); !ok {
|
||||
println("something")
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import "C"
|
||||
|
||||
import "issue18676/dynamodbstreamsevt"
|
||||
|
||||
func F(evt *dynamodbstreamsevt.Event) {}
|
||||
@@ -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
|
||||
}
|
||||
@@ -15,8 +15,8 @@ goos=$(go env GOOS)
|
||||
goarch=$(go env GOARCH)
|
||||
|
||||
function cleanup() {
|
||||
rm -f plugin*.so unnamed*.so iface*.so
|
||||
rm -rf host pkg sub iface issue18676 issue19534
|
||||
rm -f plugin*.so unnamed*.so
|
||||
rm -rf host pkg sub
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
@@ -32,21 +32,3 @@ GOPATH=$(pwd) go build -buildmode=plugin unnamed2.go
|
||||
GOPATH=$(pwd) go build host
|
||||
|
||||
LD_LIBRARY_PATH=$(pwd) ./host
|
||||
|
||||
# Test that types and itabs get properly uniqified.
|
||||
GOPATH=$(pwd) go build -buildmode=plugin iface_a
|
||||
GOPATH=$(pwd) go build -buildmode=plugin iface_b
|
||||
GOPATH=$(pwd) go build iface
|
||||
LD_LIBRARY_PATH=$(pwd) ./iface
|
||||
|
||||
# Test for issue 18676 - make sure we don't add the same itab twice.
|
||||
# The buggy code hangs forever, so use a timeout to check for that.
|
||||
GOPATH=$(pwd) go build -buildmode=plugin -o plugin.so src/issue18676/plugin.go
|
||||
GOPATH=$(pwd) go build -o issue18676 src/issue18676/main.go
|
||||
timeout 10s ./issue18676
|
||||
|
||||
# Test for issue 19534 - that we can load a plugin built in a path with non-alpha
|
||||
# characters
|
||||
GOPATH=$(pwd) go build -buildmode=plugin -ldflags='-pluginpath=issue.19534' -o plugin.so src/issue19534/plugin.go
|
||||
GOPATH=$(pwd) go build -o issue19534 src/issue19534/main.go
|
||||
./issue19534
|
||||
|
||||
@@ -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() {}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This program segfaulted during libpreinit when built with -msan:
|
||||
// http://golang.org/issue/18707
|
||||
|
||||
package main
|
||||
|
||||
import "C"
|
||||
|
||||
func main() {}
|
||||
@@ -68,25 +68,6 @@ fi
|
||||
|
||||
status=0
|
||||
|
||||
testmsanshared() {
|
||||
goos=$(go env GOOS)
|
||||
suffix="-installsuffix testsanitizers"
|
||||
libext="so"
|
||||
if [ "$goos" = "darwin" ]; then
|
||||
libext="dylib"
|
||||
fi
|
||||
go build -msan -buildmode=c-shared $suffix -o ${TMPDIR}/libmsanshared.$libext msan_shared.go
|
||||
|
||||
echo 'int main() { return 0; }' > ${TMPDIR}/testmsanshared.c
|
||||
$CC $(go env GOGCCFLAGS) -fsanitize=memory -o ${TMPDIR}/testmsanshared ${TMPDIR}/testmsanshared.c ${TMPDIR}/libmsanshared.$libext
|
||||
|
||||
if ! LD_LIBRARY_PATH=. ${TMPDIR}/testmsanshared; then
|
||||
echo "FAIL: msan_shared"
|
||||
status=1
|
||||
fi
|
||||
rm -f ${TMPDIR}/{testmsanshared,testmsanshared.c,libmsanshared.$libext}
|
||||
}
|
||||
|
||||
if test "$msan" = "yes"; then
|
||||
if ! go build -msan std; then
|
||||
echo "FAIL: build -msan std"
|
||||
@@ -127,47 +108,23 @@ if test "$msan" = "yes"; then
|
||||
echo "FAIL: msan_fail"
|
||||
status=1
|
||||
fi
|
||||
|
||||
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 +156,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 +169,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")
|
||||
}
|
||||
@@ -827,14 +815,3 @@ func TestImplicitInclusion(t *testing.T) {
|
||||
goCmd(t, "install", "-linkshared", "implicitcmd")
|
||||
run(t, "running executable linked against library that contains same package as it", "./bin/implicitcmd")
|
||||
}
|
||||
|
||||
// Tests to make sure that the type fields of empty interfaces and itab
|
||||
// fields of nonempty interfaces are unique even across modules,
|
||||
// so that interface equality works correctly.
|
||||
func TestInterface(t *testing.T) {
|
||||
goCmd(t, "install", "-buildmode=shared", "-linkshared", "iface_a")
|
||||
// Note: iface_i gets installed implicitly as a dependency of iface_a.
|
||||
goCmd(t, "install", "-buildmode=shared", "-linkshared", "iface_b")
|
||||
goCmd(t, "install", "-linkshared", "iface")
|
||||
run(t, "running type/itab uniqueness tester", "./bin/iface")
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
var SlicePtr interface{} = &[]int{}
|
||||
|
||||
var V int = 1
|
||||
|
||||
var HasMask []string = []string{"hi"}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,6 @@ func F() *C {
|
||||
return nil
|
||||
}
|
||||
|
||||
var slicePtr interface{} = &[]int{}
|
||||
|
||||
func main() {
|
||||
defer depBase.ImplementedInAsm()
|
||||
// This code below causes various go.itab.* symbols to be generated in
|
||||
@@ -34,11 +32,4 @@ func main() {
|
||||
if reflect.TypeOf(F).Out(0) != reflect.TypeOf(c) {
|
||||
panic("bad reflection results, see golang.org/issue/18252")
|
||||
}
|
||||
|
||||
sp := reflect.New(reflect.TypeOf(slicePtr).Elem())
|
||||
s := sp.Interface()
|
||||
|
||||
if reflect.TypeOf(s) != reflect.TypeOf(slicePtr) {
|
||||
panic("bad reflection results, see golang.org/issue/18729")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import "iface_a"
|
||||
import "iface_b"
|
||||
|
||||
func main() {
|
||||
if iface_a.F() != iface_b.F() {
|
||||
panic("empty interfaces not equal")
|
||||
}
|
||||
if iface_a.G() != iface_b.G() {
|
||||
panic("non-empty interfaces not equal")
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package iface_a
|
||||
|
||||
import "iface_i"
|
||||
|
||||
//go:noinline
|
||||
func F() interface{} {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func G() iface_i.I {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package iface_b
|
||||
|
||||
import "iface_i"
|
||||
|
||||
//go:noinline
|
||||
func F() interface{} {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func G() iface_i.I {
|
||||
return (*iface_i.T)(nil)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package iface_i
|
||||
|
||||
type I interface {
|
||||
M()
|
||||
}
|
||||
|
||||
type T struct {
|
||||
}
|
||||
|
||||
func (t *T) M() {
|
||||
}
|
||||
|
||||
// *T implements I
|
||||
@@ -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 {
|
||||
@@ -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",
|
||||
@@ -244,9 +236,20 @@ func run(bin string, args []string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
s.do(`breakpoint set -n getwd`) // in runtime/cgo/gcc_darwin_arm.go
|
||||
|
||||
started = true
|
||||
|
||||
s.doCmd("run", "stop reason = signal SIGINT", 20*time.Second)
|
||||
s.doCmd("run", "stop reason = breakpoint", 20*time.Second)
|
||||
|
||||
// Move the current working directory into the faux gopath.
|
||||
if pkgpath != "src" {
|
||||
s.do(`breakpoint delete 1`)
|
||||
s.do(`expr char* $mem = (char*)malloc(512)`)
|
||||
s.do(`expr $mem = (char*)getwd($mem, 512)`)
|
||||
s.do(`expr $mem = (char*)strcat($mem, "/` + pkgpath + `")`)
|
||||
s.do(`call (void)chdir($mem)`)
|
||||
}
|
||||
|
||||
startTestsLen := s.out.Len()
|
||||
fmt.Fprintln(s.in, `process continue`)
|
||||
@@ -256,9 +259,7 @@ func run(bin string, args []string) (err error) {
|
||||
return s.out.LastIndex([]byte("\nPASS\n")) > startTestsLen ||
|
||||
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 +347,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 +445,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,13 +518,13 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Copy timezone file.
|
||||
//
|
||||
// Typical apps have the zoneinfo.zip in the root of their app bundle,
|
||||
// read by the time package as the working directory at initialization.
|
||||
// As we move the working directory to the GOROOT pkg directory, we
|
||||
// install the zoneinfo.zip file in the pkgpath.
|
||||
if underGoRoot {
|
||||
// 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),
|
||||
filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
|
||||
@@ -531,19 +532,6 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
|
||||
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 +569,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 +577,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 +591,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)
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user