[dev.boringcrypto] all: merge master into dev.boringcrypto

Change-Id: I3cd94be655e5374b52494f756ff087352705da6d
This commit is contained in:
Katie Hockman 2019-09-03 17:04:59 -04:00
commit ff197f326f
409 changed files with 19752 additions and 13782 deletions

View file

@ -47,6 +47,7 @@ Adam Shannon <adamkshannon@gmail.com>
Adam Sindelar <adamsh@google.com>
Adam Thomason <athomason@gmail.com>
Adam Woodbeck <adam@woodbeck.net>
Adarsh Ravichandran <adarshravichandran91@gmail.com>
Aditya Mukerjee <dev@chimeracoder.net>
Adrian Hesketh <adrianhesketh@hushmail.com>
Adrian Nos <nos.adrian@gmail.com>
@ -62,12 +63,14 @@ Ahmed Wahed <oneofone@gmail.com>
Ahmet Alp Balkan <ahmetb@google.com>
Ahmet Soormally <ahmet@mangomm.co.uk>
Ahmy Yulrizka <yulrizka@gmail.com>
Ahsun Ahmed <ahmed.ahsun@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>
Al Cutter <al@google.com>
Alan Braithwaite <alan@ipaddr.org>
Alan Donovan <adonovan@google.com>
Alan Shreve <alan@inconshreveable.com>
@ -95,6 +98,7 @@ Alex Myasoedov <msoedov@gmail.com>
Alex Plugaru <alex@plugaru.org> <alexandru.plugaru@gmail.com>
Alex Schroeder <alex@gnu.org>
Alex Sergeyev <abc@alexsergeyev.com>
Alex Tokarev <aleksator@gmail.com>
Alex Vaghin <crhyme@google.com>
Alexander Demakin <alexander.demakin@gmail.com>
Alexander Döring <email@alexd.ch>
@ -103,12 +107,14 @@ Alexander Guz <kalimatas@gmail.com>
Alexander Kauer <alexander@affine.space>
Alexander Kucherenko <alxkchr@gmail.com>
Alexander Larsson <alexander.larsson@gmail.com>
Alexander Lourier <aml@rulezz.ru>
Alexander Menzhinsky <amenzhinsky@gmail.com>
Alexander Morozov <lk4d4math@gmail.com>
Alexander Neumann <alexander@bumpern.de>
Alexander Orlov <alexander.orlov@loxal.net>
Alexander Pantyukhin <apantykhin@gmail.com>
Alexander Polcyn <apolcyn@google.com>
Alexander Rakoczy <alex@golang.org>
Alexander Reece <awreece@gmail.com>
Alexander Surma <surma@surmair.de>
Alexander Zhavnerchik <alex.vizor@gmail.com>
@ -150,7 +156,9 @@ Andreas Jellinghaus <andreas@ionisiert.de> <anj@google.com>
Andreas Litt <andreas.litt@gmail.com>
Andrei Gherzan <andrei@resin.io>
Andrei Korzhevskii <a.korzhevskiy@gmail.com>
Andrei Matei <andrei@cockroachlabs.com>
Andrei Tudor Călin <mail@acln.ro>
Andrei Vagin <avagin@google.com>
Andrei Vieru <euvieru@gmail.com>
Andres Erbsen <andreser@google.com>
Andres Lowrie <andres.lowrie@gmail.com>
@ -177,6 +185,7 @@ Andrew Szeto <andrew@jabagawee.com>
Andrew Werner <andrew@upthere.com> <awerner32@gmail.com>
Andrew Wilkins <axwalk@gmail.com>
Andrew Williams <williams.andrew@gmail.com>
Andrew Z Allen <me@andrewzallen.com>
Andrey Mirtchovski <mirtchovski@gmail.com>
Andrey Petrov <andrey.petrov@shazow.net>
Andrii Soldatenko <andrii.soldatenko@gmail.com>
@ -214,8 +223,10 @@ Antonio Antelo <aantelov87@gmail.com>
Antonio Bibiano <antbbn@gmail.com>
Antonio Murdaca <runcom@redhat.com>
Antonio Troina <thoeni@gmail.com>
Aofei Sheng <aofei@aofeisheng.com>
Apisak Darakananda <pongad@gmail.com>
Aram Hăvărneanu <aram@mgk.ro>
Arash Bina <arash@arash.io>
Areski Belaid <areski@gmail.com>
Ariel Mashraki <ariel@mashraki.co.il>
Arkadi Pyuro <arkadi@google.com>
@ -266,11 +277,13 @@ Ben Shi <powerman1st@163.com>
Benjamin Black <b@b3k.us>
Benjamin Cable <cable.benjamin@gmail.com>
Benjamin Hsieh <tanookiben@users.noreply.github.com>
Benjamin Peterson <benjamin@python.org>
Benjamin Prosnitz <bprosnitz@google.com>
Benjamin Wester <bwester@squareup.com>
Benny Siegert <bsiegert@gmail.com>
Benoit Sigoure <tsunanet@gmail.com>
Berengar Lehr <Berengar.Lehr@gmx.de>
Berkant Ipek <41230766+0xbkt@users.noreply.github.com>
Bill Neubauer <wcn@golang.org> <wcn@google.com> <bill.neubauer@gmail.com>
Bill O'Farrell <billo@ca.ibm.com>
Bill Prin <waprin@google.com>
@ -278,6 +291,7 @@ Bill Thiede <couchmoney@gmail.com>
Bill Zissimopoulos <billziss@navimatics.com>
Billie Harold Cleek <bhcleek@gmail.com>
Billy Lynch <wlynch@google.com>
Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Bjorn Tillenius <bjorn@tillenius.me>
Bjorn Tipling <bjorn.tipling@gmail.com>
Blain Smith <rebelgeek@blainsmith.com>
@ -303,6 +317,7 @@ Brady Catherman <brady@gmail.com>
Brady Sullivan <brady@bsull.com>
Brandon Bennett <bbennett@fb.com>
Brandon Gilmore <varz@google.com>
Brandon Ryan <bjryan19@gmail.com>
Brendan Daniel Tracey <tracey.brendan@gmail.com>
Brendan O'Dea <bod@golang.org>
Brett Cannon <bcannon@gmail.com>
@ -321,6 +336,7 @@ Bryan Alexander <Kozical@msn.com>
Bryan C. Mills <bcmills@google.com>
Bryan Chan <bryan.chan@ca.ibm.com>
Bryan Ford <brynosaurus@gmail.com>
Bryan Heden <b.heden@gmail.com>
Bulat Gaifullin <gaifullinbf@gmail.com>
Burak Guven <bguven@gmail.com>
Caine Tighe <arctanofyourface@gmail.com>
@ -337,9 +353,11 @@ Carlisia Campos <carlisia@grokkingtech.io>
Carlo Alberto Ferraris <cafxx@strayorange.com>
Carlos Castillo <cookieo9@gmail.com>
Carlos Cirello <uldericofilho@gmail.com>
Carlos Eduardo <me@carlosedp.com>
Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Carlos Souza <carloshrsouza@gmail.com>
Carolyn Van Slyck <me@carolynvanslyck.com>
Carrie Bynon <cbynon@gmail.com>
Cary Hull <chull@google.com>
Case Nelson <case.nelson@gmail.com>
Casey Callendrello <squeed@gmail.com>
@ -373,6 +391,7 @@ Chris Kastorff <encryptio@gmail.com>
Chris Lennert <calennert@gmail.com>
Chris Liles <caveryliles@gmail.com>
Chris Manghane <cmang@golang.org>
Chris Marchesi <chrism@vancluevertech.com>
Chris McGee <sirnewton_01@yahoo.ca> <newton688@gmail.com>
Chris Raynor <raynor@google.com>
Chris Roche <rodaine@gmail.com>
@ -404,6 +423,7 @@ Clément Chigot <clement.chigot@atos.net>
Clement Skau <clementskau@gmail.com>
Cody Oss <the.cody.oss@gmail.com>
Colby Ranger <cranger@google.com>
Colin Arnott <colin@urandom.co.uk>
Colin Cross <ccross@android.com>
Colin Edwards <colin@recursivepenguin.com>
Colin Kennedy <moshen.colin@gmail.com>
@ -436,13 +456,16 @@ Dan Johnson <computerdruid@google.com>
Dan Peterson <dpiddy@gmail.com>
Dan Pupius <dan@medium.com>
Dan Sinclair <dan.sinclair@gmail.com>
Daniel Cormier <danielc@knowbe4.com>
Daniël de Kok <me@danieldk.eu>
Daniel Fleischman <danielfleischman@gmail.com>
Daniel Ingram <ingramds@appstate.edu>
Daniel Johansson <dajo2002@gmail.com>
Daniel Kerwin <d.kerwin@gini.net>
Daniel Krech <eikeon@eikeon.com>
Daniel Langner <s8572327@gmail.com>
Daniel Lidén <daniel.liden.87@gmail.com>
Daniel Lublin <daniel@lublin.se>
Daniel Martí <mvdan@mvdan.cc>
Daniel Morsing <daniel.morsing@gmail.com>
Daniel Nadasi <dnadasi@google.com>
@ -457,6 +480,7 @@ Danny Rosseau <daniel.rosseau@gmail.com>
Daria Kolistratova <daria.kolistratova@intel.com>
Darien Raymond <admin@v2ray.com>
Darren Elwood <darren@textnode.com>
Darren Grant <darren.e.grant@gmail.com>
Darshan Parajuli <parajulidarshan@gmail.com>
Datong Sun <dndx@idndx.com>
Dave Borowitz <dborowitz@google.com>
@ -516,6 +540,7 @@ Derek Buitenhuis <derek.buitenhuis@gmail.com>
Derek Che <drc@yahoo-inc.com>
Derek McGowan <derek@mcgstyle.net>
Derek Parker <parkerderek86@gmail.com>
Derek Phan <derekphan94@gmail.com>
Derek Shockey <derek.shockey@gmail.com>
Dev Ojha <dojha12@gmail.com>
Dev Zhoujun <dev.zhoujun@gmail.com>
@ -534,6 +559,7 @@ Dina Garmash <dgrmsh@gmail.com>
Diogo Pinela <diogoid7400@gmail.com>
Dirk Gadsden <dirk@esherido.com>
Diwaker Gupta <diwakergupta@gmail.com>
Dmitri Goutnik <dgoutnik@gmail.com>
Dmitri Popov <operator@cv.dp-net.com>
Dmitri Shuralyov <dmitshur@golang.org> <dmitri@shuralyov.com>
Dmitriy Cherchenko <dcherchenko@gmail.com>
@ -542,6 +568,7 @@ Dmitriy Shelenin <deemok@googlemail.com> <deemok@gmail.com>
Dmitriy Vyukov <dvyukov@google.com>
Dmitry Chestnykh <dchest@gmail.com>
Dmitry Doroginin <doroginin@gmail.com>
Dmitry Mottl <dmitry.mottl@gmail.com>
Dmitry Neverov <dmitry.neverov@gmail.com>
Dmitry Savintsev <dsavints@gmail.com>
Dmitry Yakunin <nonamezeil@gmail.com>
@ -578,6 +605,7 @@ Eivind Uggedal <eivind@uggedal.com>
Elbert Fliek <efliek@gmail.com>
Eldar Rakhimberdin <ibeono@gmail.com>
Elena Grahovac <elena@grahovac.me>
Eli Bendersky <eliben@google.com>
Elias Naur <mail@eliasnaur.com> <elias.naur@gmail.com>
Elliot Morrison-Reed <elliotmr@gmail.com>
Emerson Lin <linyintor@gmail.com>
@ -615,6 +643,7 @@ Euan Kemp <euank@euank.com>
Eugene Kalinin <e.v.kalinin@gmail.com>
Evan Broder <evan@stripe.com>
Evan Brown <evanbrown@google.com>
Evan Digby <evandigby@gmail.com>
Evan Hicks <evan.hicks2@gmail.com>
Evan Jones <ej@evanjones.ca>
Evan Klitzke <evan@eklitzke.org>
@ -639,7 +668,9 @@ Fazlul Shahriar <fshahriar@gmail.com>
Federico Bond <federicobond@gmail.com>
Federico Simoncelli <fsimonce@redhat.com>
Fedor Indutny <fedor@indutny.com>
Fedor Korotkiy <dartslon@gmail.com>
Felipe Oliveira <felipeweb.programador@gmail.com>
Felix Bünemann <Felix.Buenemann@gmail.com>
Felix Geisendörfer <haimuiba@gmail.com>
Felix Kollmann <fk@konsorten.de>
Filip Gruszczyński <gruszczy@gmail.com>
@ -654,6 +685,7 @@ Florin Patan <florinpatan@gmail.com>
Folke Behrens <folke@google.com>
Ford Hurley <ford.hurley@gmail.com>
Francesc Campoy <campoy@golang.org>
Francesco Renzi <rentziass@gmail.com>
Francisco Claude <fclaude@recoded.cl>
Francisco Rojas <francisco.rojas.gallegos@gmail.com>
Francisco Souza <franciscossouza@gmail.com>
@ -673,6 +705,8 @@ G. Hussain Chinoy <ghchinoy@gmail.com>
Gaal Yahas <gaal@google.com>
Gabríel Arthúr Pétursson <gabriel@system.is>
Gabriel Aszalos <gabriel.aszalos@gmail.com>
Gabriel Guzman <gabe.guzman@gmail.com>
Gabriel Nelle <tehsphinx@web.de>
Gabriel Nicolas Avellaneda <avellaneda.gabriel@gmail.com>
Gabriel Russell <gabriel.russell@gmail.com>
Gareth Paul Jones <gpj@foursquare.com>
@ -695,14 +729,17 @@ George Shammas <george@shamm.as> <georgyo@gmail.com>
Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>
Gerasimos Dimitriadis <gedimitr@gmail.com>
Gergely Brautigam <skarlso777@gmail.com>
Gernot Vormayr <gvormayr@gmail.com>
Getulio Sánchez <valentin2507@gmail.com>
Gianguido Sora` <g.sora4@gmail.com>
Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
Giles Lean <giles.lean@pobox.com>
Giovanni Bajo <rasky@develer.com>
GitHub User @ajnirp (1688456) <ajnirp@users.noreply.github.com>
GitHub User @alkesh26 (1019076) <alkesh26@gmail.com>
GitHub User @andrius4669 (4699695) <andrius4669@gmail.com>
GitHub User @as (8127015) <as.utf8@gmail.com>
GitHub User @bakape (7851952) <bakape@gmail.com>
GitHub User @bgadrian (830001) <aditza8@gmail.com>
GitHub User @bontequero (2674999) <bontequero@gmail.com>
GitHub User @cch123 (384546) <buaa.cch@gmail.com>
@ -710,11 +747,16 @@ GitHub User @chanxuehong (3416908) <chanxuehong@gmail.com>
GitHub User @dupoxy (1143957) <dupoxy@users.noreply.github.com>
GitHub User @erifan (31343225) <eric.fang@arm.com>
GitHub User @esell (9735165) <eujon.sellers@gmail.com>
GitHub User @frennkie (6499251) <mail@rhab.de>
GitHub User @hengwu0 (41297446) <41297446+hengwu0@users.noreply.github.com>
GitHub User @itchyny (375258) <itchyny@hatena.ne.jp>
GitHub User @kazyshr (30496953) <kazyshr0301@gmail.com>
GitHub User @kc1212 (1093806) <kc1212@users.noreply.github.com>
GitHub User @Kropekk (13366453) <kamilkropiewnicki@gmail.com>
GitHub User @linguohua (3434367) <lghchinaidea@gmail.com>
GitHub User @LotusFenn (13775899) <fenn.lotus@gmail.com>
GitHub User @madiganz (18340029) <zacharywmadigan@gmail.com>
GitHub User @micnncim (21333876) <micnncim@gmail.com>
GitHub User @mkishere (224617) <224617+mkishere@users.noreply.github.com>
GitHub User @OlgaVlPetrova (44112727) <OVPpetrova@gmail.com>
GitHub User @pityonline (438222) <pityonline@gmail.com>
@ -724,6 +766,7 @@ GitHub User @shogo-ma (9860598) <Choroma194@gmail.com>
GitHub User @tell-k (26263) <ffk2005@gmail.com>
GitHub User @uhei (2116845) <uhei@users.noreply.github.com>
GitHub User @uropek (39370426) <uropek@gmail.com>
GitHub User @ZZMarquis (7624583) <zhonglingjian3821@163.com>
Giulio Iotti <dullgiulio@gmail.com>
Giulio Micheloni <giulio.micheloni@gmail.com>
Giuseppe Valente <gvalente@arista.com>
@ -731,11 +774,13 @@ Gleb Stepanov <glebstepanov1992@gmail.com>
Glenn Brown <glennb@google.com>
Glenn Lewis <gmlewis@google.com>
Gordon Klaus <gordon.klaus@gmail.com>
Gordon Tyler <gordon@doxxx.net>
Graham King <graham4king@gmail.com>
Graham Miller <graham.miller@gmail.com>
Grant Griffiths <ggp493@gmail.com>
Greg Poirier <greg.istehbest@gmail.com>
Greg Steuck <gnezdo+github@google.com>
Greg Thelen <gthelen@google.com>
Greg Ward <greg@gerg.ca>
Grégoire Delattre <gregoire.delattre@gmail.com>
Gregory Man <man.gregory@gmail.com>
@ -759,12 +804,14 @@ HAMANO Tsukasa <hamano@osstech.co.jp>
Han-Wen Nienhuys <hanwen@google.com>
Hang Qian <hangqian90@gmail.com>
Hanjun Kim <hallazzang@gmail.com>
Haosdent Huang <haosdent@gmail.com>
Harald Nordgren <haraldnordgren@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>
Hasan Ozgan <hasan@ozgan.net>
Hauke Löffler <hloeffler@users.noreply.github.com>
Håvard Haugen <havard.haugen@gmail.com>
He Liu <liulonnie@gmail.com>
@ -777,6 +824,7 @@ Henry Adi Sumarto <henry.adisumarto@gmail.com>
Henry Bubert <google@mindeco.de>
Henry Chang <mr.changyuheng@gmail.com>
Henry Clifford <h.a.clifford@gmail.com>
Henry Wong <liushuai.wang@elastic.co>
Herbert Georg Fischer <herbert.fischer@gmail.com>
Herbie Ong <herbie@google.com>
Heschi Kreinick <heschi@google.com>
@ -789,6 +837,7 @@ Hitoshi Mitake <mitake.hitoshi@gmail.com>
Holden Huang <ttyh061@gmail.com>
Hong Ruiqi <hongruiqi@gmail.com>
Hongfei Tan <feilengcui008@gmail.com>
Horst Rutter <hhrutter@gmail.com>
Hossein Sheikh Attar <hattar@google.com>
Hsin Tsao <tsao@google.com>
Hsin-Ho Yeh <yhh92u@gmail.com>
@ -831,6 +880,7 @@ Ivan Krasin <krasin@golang.org>
Ivan Kutuzov <arbrix@gmail.com>
Ivan Markin <sw@nogoegst.net>
Ivan Moscoso <moscoso@gmail.com>
Ivan Osadchiy <ivan.osadchii@gmail.com>
Ivan Sharavuev <shpiwan@gmail.com>
Ivan Ukhov <ivan.ukhov@gmail.com>
Ivy Evans <ivy@ivyevans.net>
@ -838,8 +888,10 @@ Jaana Burcu Dogan <jbd@google.com> <jbd@golang.org> <burcujdogan@gmail.com>
Jack Britton <jackxbritton@gmail.com>
Jack Lindamood <jlindamo@justin.tv>
Jacob Baskin <jbaskin@google.com>
Jacob Blain Christen <dweomer5@gmail.com>
Jacob H. Haven <jacob@cloudflare.com>
Jacob Hoffman-Andrews <github@hoffman-andrews.com>
Jacob Walker <jacobwalker0814@gmail.com>
Jae Kwon <jae@tendermint.com>
Jake B <doogie1012@gmail.com>
Jakob Borg <jakob@nym.se>
@ -860,6 +912,7 @@ James Lawrence <jljatone@gmail.com>
James Meneghello <rawrz0r@gmail.com>
James Myers <jfmyers9@gmail.com>
James Neve <jamesoneve@gmail.com>
James Nugent <james@jen20.com>
James P. Cooper <jamespcooper@gmail.com>
James Robinson <jamesr@google.com> <jamesr.gatech@gmail.com>
James Schofield <james@shoeboxapp.com>
@ -886,6 +939,7 @@ Jan Newmarch <jan.newmarch@gmail.com>
Jan Pilzer <jan.pilzer@gmx.de>
Jan Ziak <0xe2.0x9a.0x9b@gmail.com>
Jani Monoses <jani.monoses@ubuntu.com> <jani.monoses@gmail.com>
Jannis Andrija Schnitzer <jannis@schnitzer.im>
Jared Culp <jculp14@gmail.com>
Jaroslavas Počepko <jp@webmaster.ms>
Jason A. Donenfeld <Jason@zx2c4.com>
@ -906,6 +960,7 @@ Jay Taylor <outtatime@gmail.com>
Jay Weisskopf <jay@jayschwa.net>
Jean de Klerk <deklerk@google.com>
Jean-André Santoni <jean.andre.santoni@gmail.com>
Jean-François Bustarret <jf@bustarret.com>
Jean-Francois Cantin <jfcantin@gmail.com>
Jean-Marc Eurin <jmeurin@google.com>
Jean-Nicolas Moal <jn.moal@gmail.com>
@ -927,8 +982,10 @@ Jeremiah Harmsen <jeremiah@google.com>
Jeremy Banks <_@jeremy.ca>
Jeremy Canady <jcanady@gmail.com>
Jeremy Jackins <jeremyjackins@gmail.com>
Jeremy Jay <jeremy@pbnjay.com>
Jeremy Schlatter <jeremy.schlatter@gmail.com>
Jeroen Bobbeldijk <jerbob92@gmail.com>
Jeroen Simonetti <jeroen@simonetti.nl>
Jerrin Shaji George <jerrinsg@gmail.com>
Jess Frazelle <me@jessfraz.com>
Jesse Szwedko <jesse.szwedko@gmail.com>
@ -945,6 +1002,8 @@ Jimmy Zelinskie <jimmyzelinskie@gmail.com>
Jin-wook Jeong <jeweljar@hanmail.net>
Jingcheng Zhang <diogin@gmail.com>
Jingguo Yao <yaojingguo@gmail.com>
Jingnan Si <jingnan.si@gmail.com>
Jinkun Zhang <franksnolf@gmail.com>
Jiong Du <londevil@gmail.com>
Jirka Daněk <dnk@mail.muni.cz>
Jiulong Wang <jiulongw@gmail.com>
@ -979,12 +1038,14 @@ John Howard Palevich <jack.palevich@gmail.com>
John Jeffery <jjeffery@sp.com.au>
John Jenkins <twodopeshaggy@gmail.com>
John Leidegren <john.leidegren@gmail.com>
John Moore <johnkenneth.moore@gmail.com>
John Newlin <jnewlin@google.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>
John Weldon <johnweldon4@gmail.com>
Johnny Luo <johnnyluo1980@gmail.com>
Jon Chen <jchen@justin.tv>
Jonas Bernoulli <jonas@bernoul.li>
@ -1002,11 +1063,13 @@ Jonathan Pittman <jmpittman@google.com> <jonathan.mark.pittman@gmail.com>
Jonathan Rudenberg <jonathan@titanous.com>
Jonathan Stacks <jonstacks13@gmail.com>
Jonathan Wills <runningwild@gmail.com>
Jonathon Lacher <jonathon.lacher@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>
Jordan Liggitt <liggitt@google.com>
Jordan Rhee <jordanrh@microsoft.com>
Jos Visser <josv@google.com>
Jose Luis Vázquez González <josvazg@gmail.com>
@ -1022,11 +1085,13 @@ Josh Roppo <joshroppo@gmail.com>
Josh Varga <josh.varga@gmail.com>
Joshua Boelter <joshua.boelter@intel.com>
Joshua Chase <jcjoshuachase@gmail.com>
Joshua M. Clulow <josh.clulow@joyent.com>
Joshua Rubin <joshua@rubixconsulting.com>
Josselin Costanzi <josselin@costanzi.fr>
Jostein Stuhaug <js@solidsystem.no>
JP Sugarbroad <jpsugar@google.com>
JT Olds <jtolds@xnet5.com>
JT Olio <hello@jtolio.com>
Juan Carlos <juanjcsr@gmail.com>
Juan Pablo Civile <elementohb@gmail.com>
Jude Pereira <judebpereira@gmail.com>
@ -1043,11 +1108,14 @@ Julio Montes <julio.montes@intel.com>
Junda Liu <junda@celer.network>
Jungho Ahn <jhahn@google.com>
Junya Hayashi <ledmonster@gmail.com>
Juraj Sukop <sukop@users.noreply.github.com>
Jure Ham <jure.ham@zemanta.com>
Justin Gracenin <jgracenin@gmail.com>
Justin Li <git@justinli.net>
Justin Nuß <nuss.justin@gmail.com>
Justyn Temme <justyntemme@gmail.com>
Kai Backman <kaib@golang.org>
Kai Dong <dokia2357@gmail.com>
Kai Trukenmüller <ktye78@gmail.com>
Kale Blankenship <kale@lemnisys.com>
Kaleb Elwert <kelwert@atlassian.com>
@ -1060,6 +1128,7 @@ Karan Dhiman <karandhi@ca.ibm.com>
Karel Pazdera <pazderak@gmail.com>
Karoly Negyesi <chx1975@gmail.com>
Karsten Köhler <karsten.koehler95@gmail.com>
Karthik Nayak <karthik.188@gmail.com>
Kashav Madan <kshvmdn@gmail.com>
Kate Manson <kate.manson@izettle.com>
Katie Hockman <katie@golang.org>
@ -1081,10 +1150,13 @@ Ken Friedenbach <kenliz@cruzio.com>
Ken Rockot <ken@oz.gs> <ken.rockot@gmail.com>
Ken Sedgwick <ken@bonsai.com>
Ken Thompson <ken@golang.org>
Kenichi Tsunokawa <kenichi.tsunokawa@gmail.com>
Kenji Kaneda <kenji.kaneda@gmail.com>
Kenji Yano <kenji.yano@gmail.com>
Kenneth Shaw <kenshaw@gmail.com>
Kenny Grant <kennygrant@gmail.com>
Kenta Mori <zoncoen@gmail.com>
Ketan Parmar <ketanbparmar@gmail.com>
Kevin Ballard <kevin@sb.org>
Kevin Burke <kev@inburke.com>
Kevin Kirsche <kev.kirsche@gmail.com>
@ -1097,6 +1169,7 @@ Kieran Colford <kieran@kcolford.com>
Kim Shrier <kshrier@racktopsystems.com>
Kim Yongbin <kybinz@gmail.com>
Kir Kolyshkin <kolyshkin@gmail.com>
Kirill Motkov <Motkov.Kirill@gmail.com>
Kirill Smelkov <kirr@nexedi.com>
Kirk Han <kirk91.han@gmail.com>
Kirklin McDonald <kirklin.mcdonald@gmail.com>
@ -1111,6 +1184,7 @@ Kris Kwiatkowski <kris@cloudflare.com>
Kris Nova <kris@nivenly.com>
Kris Rousey <krousey@google.com>
Kristopher Watts <traetox@gmail.com>
Kshitij Saraogi <kshitijsaraogi@gmail.com>
Kun Li <likunarmstrong@gmail.com>
Kunpei Sakai <namusyaka@gmail.com>
Kuntal Majumder <hellozee@disroot.org>
@ -1145,12 +1219,14 @@ Leigh McCulloch <leighmcc@gmail.com>
Leo Antunes <leo@costela.net>
Leo Rudberg <ljr@google.com>
Leon Klingele <git@leonklingele.de>
Leonardo Comelli <leonardo.comelli@gmail.com>
Leonel Quinteros <leonel.quinteros@gmail.com>
Lev Shamardin <shamardin@gmail.com>
Lewin Bormann <lewin.bormann@gmail.com>
Lion Yang <lion@aosc.xyz>
Lloyd Dewolf <foolswisdom@gmail.com>
Lorenz Bauer <lmb@cloudflare.com>
Lorenz Nickel <mail@lorenznickel.de>
Lorenzo Masini <rugginoso@develer.com>
Lorenzo Stoakes <lstoakes@gmail.com>
Louis Kruger <louisk@google.com>
@ -1166,7 +1242,9 @@ Ludi Rehak <ludi317@gmail.com>
Luigi Riefolo <luigi.riefolo@gmail.com>
Luit van Drongelen <luitvd@gmail.com>
Luka Zakrajšek <tr00.g33k@gmail.com>
Luka Zitnik <luka.zitnik@gmail.com>
Lukasz Milewski <lmmilewski@gmail.com>
Luke Champine <luke.champine@gmail.com>
Luke Curley <qpingu@gmail.com>
Luke Granger-Brown <git@lukegb.com>
Luna Duclos <luna.duclos@palmstonegames.com>
@ -1176,6 +1254,7 @@ Lynn Boger <laboger@linux.vnet.ibm.com>
Ma Peiqi <mapeiqi2017@gmail.com>
Maarten Bezemer <maarten.bezemer@gmail.com>
Maciej Dębski <maciejd@google.com>
Madhu Rajanna <madhupr007@gmail.com>
Magnus Hiie <magnus.hiie@gmail.com>
Maicon Costa <maiconscosta@gmail.com>
Mak Kolybabi <mak@kolybabi.com>
@ -1189,6 +1268,7 @@ Mansour Rahimi <rahimi.mnr@gmail.com>
Manu Garg <manugarg@google.com>
Manu S Ajith <neo@codingarena.in>
Manuel Mendez <mmendez534@gmail.com>
Marat Khabibullin <marat.khabibullin@jetbrains.com>
Marc Weistroff <marc@weistroff.net>
Marc-Antoine Ruel <maruel@chromium.org>
Marcel Edmund Franke <marcel.edmund.franke@gmail.com>
@ -1200,6 +1280,7 @@ Marcus Willock <crazcalm@gmail.com>
Marga Manterola <marga@google.com>
Marin Bašić <marin.basic02@gmail.com>
Mario Arranz <marioarranzr@gmail.com>
Marius A. Eriksen <marius@grailbio.com>
Marius Nuennerich <mnu@google.com>
Mark Adams <mark@markadams.me>
Mark Bucciarelli <mkbucc@gmail.com>
@ -1210,6 +1291,7 @@ Mark Rushakoff <mark.rushakoff@gmail.com>
Mark Ryan <mark.d.ryan@intel.com>
Mark Severson <miquella@gmail.com>
Mark Theunissen <mark.theunissen@gmail.com>
Mark Villacampa <m@markvillacampa.com>
Mark Wolfe <mark@wolfe.id.au>
Mark Zavislak <zavislak@google.com>
Marko Juhani Silokunnas <marko.silokunnas@gmail.com>
@ -1285,7 +1367,9 @@ Matthieu Olivier <olivier.matthieu@gmail.com>
Matthijs Kooijman <matthijs@stdin.nl>
Max Riveiro <kavu13@gmail.com>
Max Schmitt <max@schmitt.mx>
Max Semenik <maxsem.wiki@gmail.com>
Max Ushakov <ushmax@gmail.com>
Maxim Eryomenko <moeryomenko@gmail.com>
Maxim Khitrov <max@mxcrypt.com>
Maxim Pimenov <mpimenov@google.com>
Maxim Ushakov <ushakov@google.com>
@ -1301,6 +1385,7 @@ Micah Stetson <micah.stetson@gmail.com>
Michael Anthony Knyszek <mknyszek@google.com>
Michael Brandenburg <mbrandenburg@bolste.com>
Michael Chaten <mchaten@gmail.com>
Michael Cook <code@mdcook.net>
Michael Darakananda <pongad@google.com>
Michael Dorner <mail@michaeldorner.de>
Michael Edwards <medwards@walledcity.ca>
@ -1336,6 +1421,7 @@ Michael T. Jones <mtj@google.com> <michael.jones@gmail.com>
Michael Teichgräber <mteichgraeber@gmx.de> <mt4swm@googlemail.com>
Michael Traver <mtraver@google.com>
Michael Vetter <g.bluehut@gmail.com>
Michael Vogt <mvo@ubuntu.com>
Michal Bohuslávek <mbohuslavek@gmail.com>
Michal Cierniak <cierniak@google.com>
Michał Derkacz <ziutek@lnet.pl>
@ -1344,10 +1430,13 @@ Michal Pristas <michal.pristas@gmail.com>
Michal Rostecki <mrostecki@suse.de>
Michalis Kargakis <michaliskargakis@gmail.com>
Michel Lespinasse <walken@google.com>
Mickael Kerjean <mickael.kerjean@gmail.com>
Mickey Reiss <mickeyreiss@gmail.com>
Miek Gieben <miek@miek.nl> <remigius.gieben@gmail.com>
Miguel Mendez <stxmendez@gmail.com>
Miguel Molina <hi@mvader.me>
Mihai Borobocea <MihaiBorobocea@gmail.com>
Mihai Moldovan <ionic@ionic.de>
Mihai Todor <todormihai@gmail.com>
Mihail Minaev <minaev.mike@gmail.com>
Mikael Tillenius <mikti42@gmail.com>
@ -1372,6 +1461,7 @@ Milan Knezevic <milan.knezevic@mips.com>
Milutin Jovanović <jovanovic.milutin@gmail.com>
MinJae Kwon <mingrammer@gmail.com>
Miquel Sabaté Solà <mikisabate@gmail.com>
Mirko Hansen <baaazen@gmail.com>
Miroslav Genov <mgenov@gmail.com>
Misty De Meo <mistydemeo@gmail.com>
Mohit Agarwal <mohit@sdf.org>
@ -1386,7 +1476,9 @@ Mostyn Bramley-Moore <mostyn@antipode.se>
Mrunal Patel <mrunalp@gmail.com>
Muhammad Falak R Wani <falakreyaz@gmail.com>
Muhammed Uluyol <uluyol0@gmail.com>
Muir Manders <muir@mnd.rs>
Mura Li <mura_li@castech.com.tw>
Mykhailo Lesyk <mikhail@lesyk.org>
Nan Deng <monnand@gmail.com>
Naoki Kanatani <k12naoki@gmail.com>
Nate Wilkinson <nathanwilk7@gmail.com>
@ -1414,6 +1506,7 @@ Nicholas Ng <nickng@nickng.io>
Nicholas Presta <nick@nickpresta.ca> <nick1presta@gmail.com>
Nicholas Sullivan <nicholas.sullivan@gmail.com>
Nicholas Waples <nwaples@gmail.com>
Nick Anthony <Liberatys@outlook.com>
Nick Cooper <nmvc@google.com>
Nick Craig-Wood <nick@craig-wood.com> <nickcw@gmail.com>
Nick Harper <nharper@google.com>
@ -1434,10 +1527,12 @@ Nigel Kerr <nigel.kerr@gmail.com>
Nigel Tao <nigeltao@golang.org>
Nik Nyby <nnyby@columbia.edu>
Nikhil Benesch <nikhil.benesch@gmail.com>
Nikita Kryuchkov <nkryuchkov10@gmail.com>
Niklas Schnelle <niklas.schnelle@gmail.com>
Niko Dziemba <niko@dziemba.com>
Nikolay Turpitko <nikolay@turpitko.com>
Nils Larsgård <nilsmagnus@gmail.com>
Nir Soffer <nirsof@gmail.com>
Niranjan Godbole <niranjan8192@gmail.com>
Nishanth Shanmugham <nishanth.gerrard@gmail.com>
Noah Campbell <noahcampbell@gmail.com>
@ -1445,6 +1540,7 @@ Noble Johnson <noblepoly@gmail.com>
Nodir Turakulov <nodir@google.com>
Noel Georgi <git@frezbo.com>
Norberto Lopes <nlopes.ml@gmail.com>
Norman B. Lancaster <qbradq@gmail.com>
Odin Ugedal <odin@ugedal.com>
Oleg Bulatov <dmage@yandex-team.ru>
Oleg Vakheta <helginet@gmail.com>
@ -1472,6 +1568,7 @@ Parker Moore <parkrmoore@gmail.com>
Parminder Singh <parmsingh101@gmail.com>
Pascal S. de Kloe <pascal@quies.net>
Pat Moroney <pat@pat.email>
Patrick Barker <barkerp@vmware.com>
Patrick Crosby <patrick@stathat.com>
Patrick Gavlin <pgavlin@gmail.com>
Patrick Higgins <patrick.allen.higgins@gmail.com>
@ -1481,6 +1578,7 @@ Patrick Mylund Nielsen <patrick@patrickmn.com>
Patrick Pelletier <pp.pelletier@gmail.com>
Patrick Riley <pfr@google.com>
Patrick Smith <pat42smith@gmail.com>
Patrik Lundin <patrik@sigterm.se>
Paul A Querna <paul.querna@gmail.com>
Paul Borman <borman@google.com>
Paul Boyd <boyd.paul2@gmail.com>
@ -1537,6 +1635,7 @@ Peter Weinberger <pjw@golang.org>
Peter Williams <pwil3058@gmail.com>
Peter Wu <pwu@cloudflare.com>
Peter Zhang <i@ddatsh.com>
Petr Jediný <petr.jediny@gmail.com>
Petrica Voicu <pvoicu@paypal.com>
Phil Pearl <philip.j.r.pearl@gmail.com>
Phil Pennock <pdp@golang.org>
@ -1613,6 +1712,7 @@ Rob Earhart <earhart@google.com>
Rob Norman <rob.norman@infinitycloud.com>
Rob Phoenix <rob@robphoenix.com>
Rob Pike <r@golang.org>
Robert Ayrapetyan <robert.ayrapetyan@gmail.com>
Robert Daniel Kortschak <dan.kortschak@adelaide.edu.au> <dan@kortschak.io>
Robert Dinu <r@varp.se>
Robert Figueiredo <robfig@gmail.com>
@ -1623,6 +1723,7 @@ Robert Obryk <robryk@gmail.com>
Robert Sesek <rsesek@google.com>
Robert Snedegar <roberts@google.com>
Robert Stepanek <robert.stepanek@gmail.com>
Robert van Gent <rvangent@google.com>
Robert-André Mauchin <zebob.m@gmail.com>
Roberto Clapis <robclap8@gmail.com>
Roberto Selbach <roberto@selbach.ca>
@ -1633,8 +1734,10 @@ Rodrigo Moraes de Oliveira <rodrigo.moraes@gmail.com>
Rodrigo Rafael Monti Kochenburger <divoxx@gmail.com>
Roger Pau Monné <royger@gmail.com>
Roger Peppe <rogpeppe@gmail.com>
Rohan Verma <rohanverma2004@gmail.com>
Roland Illig <roland.illig@gmx.de>
Roland Shoemaker <rolandshoemaker@gmail.com>
Romain Baugue <romain.baugue@elwinar.com>
Roman Budnikov <romanyx90@yandex.ru>
Roman Shchekin <mrqtros@gmail.com>
Ron Hashimoto <mail@h2so5.net>
@ -1667,6 +1770,7 @@ Ryuma Yoshida <ryuma.y1117@gmail.com>
Ryuzo Yamamoto <ryuzo.yamamoto@gmail.com>
S.Çağlar Onur <caglar@10ur.org>
Sabin Mihai Rapan <sabin.rapan@gmail.com>
Sad Pencil <qh06@qq.com>
Sai Cheemalapati <saicheems@google.com>
Sakeven Jiang <jc5930@sina.cn>
Salmān Aljammāz <s@0x65.net>
@ -1707,15 +1811,18 @@ Sebastian Schmidt <yath@google.com>
Sebastien Binet <seb.binet@gmail.com>
Sébastien Paolacci <sebastien.paolacci@gmail.com>
Sebastien Williams-Wynn <sebastien@cytora.com>
Segev Finer <segev208@gmail.com>
Seiji Takahashi <timaki.st@gmail.com>
Sergei Skorobogatov <skorobo@rambler.ru>
Sergey 'SnakE' Gromov <snake.scaly@gmail.com>
Sergey Arseev <sergey.arseev@intel.com>
Sergey Dobrodey <sergey.dobrodey@synesis.ru>
Sergey Frolov <sfrolov@google.com>
Sergey Lukjanov <me@slukjanov.name>
Sergey Mishin <sergeymishine@gmail.com>
Sergey Mudrik <sergey.mudrik@gmail.com>
Sergey Semin <gray12511@gmail.com>
Sergey Yanykin <syanykin@ozon.ru>
Sergio Luis O. B. Correia <sergio@correia.cc>
Sergiusz Bazanski <bazanski@gmail.com>
Serhii Aheienko <serhii.aheienko@gmail.com>
@ -1726,10 +1833,12 @@ Shamil Garatuev <garatuev@gmail.com>
Shane Hansen <shanemhansen@gmail.com>
Shaozhen Ding <dsz0111@gmail.com>
Shaun Dunning <shaun.dunning@uservoice.com>
Shawn Elliott <selliott@microsoft.com>
Shawn Ledbetter <sledbetter@google.com>
Shawn Smith <shawn.p.smith@gmail.com>
Shawn Walker-Salas <shawn.walker@oracle.com>
Shenghou Ma <minux@golang.org> <minux.ma@gmail.com>
Shengjing Zhu <zsj950618@gmail.com>
Shengyu Zhang <shengyu.zhang@chaitin.com>
Shi Han Ng <shihanng@gmail.com>
Shijie Hao <haormj@gmail.com>
@ -1737,6 +1846,7 @@ Shinji Tanaka <shinji.tanaka@gmail.com>
Shintaro Kaneko <kaneshin0120@gmail.com>
Shivakumar GN <shivakumar.gn@gmail.com>
Shivansh Rai <shivansh@freebsd.org>
Shubham Sharma <shubham.sha12@gmail.com>
Shun Fan <sfan@google.com>
Silvan Jegen <s.jegen@gmail.com>
Simon Jefford <simon.jefford@gmail.com>
@ -1758,6 +1868,7 @@ Steeve Morin <steeve.morin@gmail.com>
Stefan Nilsson <snilsson@nada.kth.se> <trolleriprofessorn@gmail.com>
Stepan Shabalin <neverliberty@gmail.com>
Stephan Renatus <srenatus@chef.io>
Stephan Zuercher <zuercher@gmail.com>
Stéphane Travostino <stephane.travostino@gmail.com>
Stephen Lewis <stephen@sock.org.uk>
Stephen Lu <steuhs@users.noreply.github.com>
@ -1769,6 +1880,7 @@ Steve Francia <spf@golang.org>
Steve Gilbert <stevegilbert23@gmail.com>
Steve LoFurno <slofurno@gmail.com>
Steve McCoy <mccoyst@gmail.com>
Steve Mynott <steve.mynott@gmail.com>
Steve Newman <snewman@google.com>
Steve Phillips <elimisteve@gmail.com>
Steve Streeting <steve@stevestreeting.com>
@ -1797,6 +1909,7 @@ Tad Fisher <tadfisher@gmail.com>
Tad Glines <tad.glines@gmail.com>
Tadas Valiukas <tadovas@gmail.com>
Taesu Pyo <pyotaesu@gmail.com>
Tai Le <letientai299@gmail.com>
Taj Khattra <taj.khattra@gmail.com>
Takashi Matsuo <tmatsuo@google.com>
Takayoshi Nishida <takayoshi.nishida@gmail.com>
@ -1856,8 +1969,10 @@ Tobias Assarsson <tobias.assarsson@gmail.com>
Tobias Columbus <tobias.columbus@gmail.com> <tobias.columbus@googlemail.com>
Tobias Klauser <tklauser@distanz.ch>
Toby Burress <kurin@google.com>
Todd Kulesza <tkulesza@google.com>
Todd Neal <todd@tneal.org>
Todd Wang <toddwang@gmail.com>
Tom Anthony <git@tomanthony.co.uk>
Tom Bergan <tombergan@google.com>
Tom Heng <zhm20070928@gmail.com>
Tom Lanyon <tomlanyon@google.com>
@ -1873,6 +1988,7 @@ Tomoya Ishizaki <zaq1tomo@gmail.com>
Tonis Tiigi <tonistiigi@gmail.com>
Tony Reix <tony.reix@bull.net>
Tony Walker <walkert.uk@gmail.com>
Tooru Takahashi <tooru.takahashi134@gmail.com>
Tor Andersson <tor.andersson@gmail.com>
Tormod Erevik Lea <tormodlea@gmail.com>
Toshiki Shima <hayabusa1419@gmail.com>
@ -1896,6 +2012,7 @@ Tyler Bui-Palsulich <tpalsulich@google.com>
Tyler Bunnell <tylerbunnell@gmail.com>
Tyler Treat <ttreat31@gmail.com>
Tzu-Jung Lee <roylee17@currant.com>
Udalov Max <re.udalov@gmail.com>
Ugorji Nwoke <ugorji@gmail.com>
Ulf Holm Nielsen <doktor@dyregod.dk>
Ulrich Kunitz <uli.kunitz@gmail.com>
@ -1906,6 +2023,7 @@ Uttam C Pawar <uttam.c.pawar@intel.com>
Vadim Grek <vadimprog@gmail.com>
Vadim Vygonets <unixdj@gmail.com>
Val Polouchkine <vpolouch@justin.tv>
Valentin Vidic <vvidic@valentin-vidic.from.hr>
Vega Garcia Luis Alfonso <vegacom@gmail.com>
Venil Noronha <veniln@vmware.com>
Veselkov Konstantin <kostozyb@gmail.com>
@ -1922,6 +2040,7 @@ Vish Subramanian <vish@google.com>
Vishvananda Ishaya <vishvananda@gmail.com>
Visweswara R <r.visweswara@gmail.com>
Vitor De Mario <vitordemario@gmail.com>
Vivek Sekhar <vsekhar@google.com>
Vlad Krasnov <vlad@cloudflare.com>
Vladimir Kovpak <cn007b@gmail.com>
Vladimir Kuzmin <vkuzmin@uber.com>
@ -1943,8 +2062,11 @@ Wèi Cōngruì <crvv.mail@gmail.com>
Wei Fu <fhfuwei@163.com>
Wei Guangjing <vcc.163@gmail.com>
Wei Xiao <wei.xiao@arm.com>
Wei Xikai <xykwei@gmail.com>
Weichao Tang <tevic.tt@gmail.com>
Wembley G. Leach, Jr <wembley.gl@gmail.com>
Wenlei (Frank) He <wlhe@google.com>
Wenzel Lowe <lowewenzel@gmail.com>
Wil Selwood <wselwood@gmail.com>
Wilfried Teiken <wteiken@google.com>
Will Beason <willbeason@gmail.com>
@ -1969,12 +2091,14 @@ Xudong Zheng <7pkvm5aw@slicealias.com>
Xuyang Kang <xuyangkang@gmail.com>
Yamagishi Kazutoshi <ykzts@desire.sh>
Yan Zou <yzou@google.com>
Yang Tian <linuxty@gmail.com>
Yann Hodique <yhodique@google.com>
Yann Kerhervé <yann.kerherve@gmail.com>
Yann Salaün <yannsalaun1@gmail.com>
Yao Zhang <lunaria21@gmail.com>
Yaron de Leeuw <jarondl@google.com>
Yasha Bubnov <girokompass@gmail.com>
Yasser Abdolmaleki <yasser@yasser.ca>
Yasuharu Goto <matope.ono@gmail.com>
Yasuhiro Matsumoto <mattn.jp@gmail.com>
Yasuyuki Oka <yasuyk@gmail.com>
@ -2003,6 +2127,7 @@ Yves Junqueira <yvesj@google.com> <yves.junqueira@gmail.com>
Zac Bergquist <zbergquist99@gmail.com>
Zach Bintliff <zbintliff@gmail.com>
Zach Gershman <zachgersh@gmail.com>
Zach Jones <zachj1@gmail.com>
Zachary Amsden <zach@thundertoken.com>
Zachary Gershman <zgershman@pivotal.io>
Zak <zrjknill@gmail.com>
@ -2018,6 +2143,7 @@ Zhongwei Yao <zhongwei.yao@arm.com>
Zhou Peng <p@ctriple.cn>
Ziad Hatahet <hatahet@gmail.com>
Zorion Arrizabalaga <zorionk@gmail.com>
Максадбек Ахмедов <a.maksadbek@gmail.com>
Максим Федосеев <max.faceless.frei@gmail.com>
Роман Хавроненко <hagen1778@gmail.com>
Тарас Буник <tbunyk@gmail.com>

8032
api/go1.13.txt Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -377,8 +377,11 @@ func (w *Watchdog) Start() {
<h2 id="Supported_Systems">Supported Systems</h2>
<p>
The race detector runs on <code>darwin/amd64</code>, <code>freebsd/amd64</code>,
<code>linux/amd64</code>, and <code>windows/amd64</code>.
The race detector runs on
<code>linux/amd64</code>, <code>linux/ppc64le</code>,
<code>linux/arm64</code>, <code>freebsd/amd64</code>,
<code>netbsd/amd64</code>, <code>darwin/amd64</code>,
and <code>windows/amd64</code>.
</p>
<h2 id="Runtime_Overheads">Runtime Overhead</h2>

View file

@ -590,27 +590,37 @@ Here follow some descriptions of key Go-specific details for the supported archi
<p>
The runtime pointer to the <code>g</code> structure is maintained
through the value of an otherwise unused (as far as Go is concerned) register in the MMU.
A OS-dependent macro <code>get_tls</code> is defined for the assembler if the source includes
a special header, <code>go_asm.h</code>:
An OS-dependent macro <code>get_tls</code> is defined for the assembler if the source is
in the <code>runtime</code> package and includes a special header, <code>go_tls.h</code>:
</p>
<pre>
#include "go_asm.h"
#include "go_tls.h"
</pre>
<p>
Within the runtime, the <code>get_tls</code> macro loads its argument register
with a pointer to the <code>g</code> pointer, and the <code>g</code> struct
contains the <code>m</code> pointer.
There's another special header containing the offsets for each
element of <code>g</code>, called <code>go_asm.h</code>.
The sequence to load <code>g</code> and <code>m</code> using <code>CX</code> looks like this:
</p>
<pre>
#include "go_tls.h"
#include "go_asm.h"
...
get_tls(CX)
MOVL g(CX), AX // Move g into AX.
MOVL g_m(AX), BX // Move g.m into BX.
</pre>
<p>
Note: The code above works only in the <code>runtime</code> package, while <code>go_tls.h</code> also
applies to <a href="#arm">arm</a>, <a href="#amd64">amd64</a> and amd64p32, and <code>go_asm.h</code> applies to all architectures.
</p>
<p>
Addressing modes:
</p>

View file

@ -238,14 +238,16 @@ $ git codereview help
</pre>
<p>
prints help text, not an error.
prints help text, not an error. If it prints an error, make sure that
<code>$GOPATH/bin</code> is in your <code>$PATH</code>.
</p>
<p>
On Windows, when using git-bash you must make sure that
<code>git-codereview.exe</code> is in your <code>git</code> exec-path.
Run <code>git --exec-path</code> to discover the right location then create a
symbolic link or just copy the executable from $GOPATH/bin to this directory.
symbolic link or just copy the executable from <code>$GOPATH/bin</code> to this
directory.
</p>

View file

@ -77,6 +77,27 @@ the go command, and the <code>crypto/x509</code>, <code>net/http</code>, and
1.12.6 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.7 (released 2019/07/08) includes fixes to cgo, the compiler,
and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.7">Go
1.12.7 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.8 (released 2019/08/13) includes security fixes to the
<code>net/http</code> and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.8">Go
1.12.8 milestone</a> on our issue tracker for details.
</p>
<p>
go1.12.9 (released 2019/08/15) includes fixes to the linker,
and the <code>os</code> and <code>math/big</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.9+label%3ACherryPickApproved">Go
1.12.9 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.11">go1.11 (released 2018/08/24)</h2>
<p>
@ -168,6 +189,19 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.11">Go
1.11.11 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.12 (released 2019/07/08) includes fixes to the compiler and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.12">Go
1.11.12 milestone</a> on our issue tracker for details.
</p>
<p>
go1.11.13 (released 2019/08/13) includes security fixes to the
<code>net/http</code> and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.13">Go
1.11.13 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.10">go1.10 (released 2018/02/16)</h2>
<p>

View file

@ -2282,8 +2282,8 @@ The <code>crypto/cipher</code> interfaces look like this:
<pre>
type Block interface {
BlockSize() int
Encrypt(src, dst []byte)
Decrypt(src, dst []byte)
Encrypt(dst, src []byte)
Decrypt(dst, src []byte)
}
type Stream interface {

View file

@ -12,7 +12,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.10</h2>

View file

@ -12,7 +12,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.11</h2>

View file

@ -12,7 +12,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.12</h2>
@ -80,6 +80,10 @@ Do not send CLs removing the interior tags from such phrases.
checks for private API usage. Since it is considered private,
<code>syscall.Getdirentries</code> now always fails with
<code>ENOSYS</code> on iOS.
Additionally, <a href="/pkg/syscall/#Setrlimit"><code>syscall.Setrlimit</code></a>
reports <code>invalid</code> <code>argument</code> in places where it historically
succeeded. These consequences are not specific to Go and users should expect
behavioral parity with <code>libSystem</code>'s implementation going forward.
</p>
<h2 id="tools">Tools</h2>

View file

@ -12,7 +12,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.13</h2>
@ -31,11 +31,8 @@ Do not send CLs removing the interior tags from such phrases.
for privacy information about these services and the
<a href="/cmd/go/#hdr-Module_downloading_and_verification">go command documentation</a>
for configuration details including how to disable the use of these servers or use
different ones.
</p>
<p>
TODO
different ones. If you depend on non-public modules, see the
<a href="/cmd/go/#hdr-Module_configuration_for_non_public_modules">documentation for configuring your environment</a>.
</p>
<h2 id="language">Changes to the language</h2>
@ -45,13 +42,13 @@ TODO
Go 1.13 supports a more uniform and modernized set of number literal prefixes.
<ul>
<li>
<a href="https://golang.org/ref/spec#Integer_literals">Binary integer literals</a>:
<a href="/ref/spec#Integer_literals">Binary integer literals</a>:
The prefix <code>0b</code> or <code>0B</code> indicates a binary integer literal
such as <code>0b1011</code>.
</li>
<li>
<a href="https://golang.org/ref/spec#Integer_literals">Octal integer literals</a>:
<a href="/ref/spec#Integer_literals">Octal integer literals</a>:
The prefix <code>0o</code> or <code>0O</code> indicates an octal integer literal
such as <code>0o660</code>.
The existing octal notation indicated by a leading <code>0</code> followed by
@ -59,7 +56,7 @@ TODO
</li>
<li>
<a href="https://golang.org/ref/spec#Floating-point_literals">Hexadecimal floating point literals</a>:
<a href="/ref/spec#Floating-point_literals">Hexadecimal floating point literals</a>:
The prefix <code>0x</code> or <code>0X</code> may now be used to express the mantissa of a
floating-point number in hexadecimal format such as <code>0x1.0p-1021</code>.
A hexadecimal floating-point number must always have an exponent, written as the letter
@ -68,7 +65,7 @@ TODO
</li>
<li>
<a href="https://golang.org/ref/spec#Imaginary_literals">Imaginary literals</a>:
<a href="/ref/spec#Imaginary_literals">Imaginary literals</a>:
The imaginary suffix <code>i</code> may now be used with any (binary, decimal, hexadecimal)
integer or floating-point literal.
</li>
@ -84,16 +81,16 @@ TODO
<p>
Per the <a href="https://github.com/golang/proposal/blob/master/design/19113-signed-shift-counts.md">signed shift counts proposal</a>
Go 1.13 removes the restriction that a <a href="https://golang.org/ref/spec#Operators">shift count</a>
Go 1.13 removes the restriction that a <a href="/ref/spec#Operators">shift count</a>
must be unsigned. This change eliminates the need for many artificial <code>uint</code> conversions,
solely introduced to satisfy this (now removed) restriction of the <code>&lt;&lt;</code> and <code>&gt;&gt;</code> operators.
</p>
<p>
These language changes were implemented by changes to the compiler, and corresponding internal changes to the library
packages <code><a href="https://golang.org/pkg/go/scanner">go/scanner</a></code> and
<code><a href="https://golang.org/pkg/text/scanner">text/scanner</a></code> (number literals),
and <code><a href="https://golang.org/pkg/go/types">go/types</a></code> (signed shift counts).
packages <code><a href="#go/scanner">go/scanner</a></code> and
<code><a href="#text/scanner">text/scanner</a></code> (number literals),
and <code><a href="#go/types">go/types</a></code> (signed shift counts).
</p>
<p>
@ -105,6 +102,23 @@ TODO
<h2 id="ports">Ports</h2>
<p>
Go 1.13 is the last release that will run on Native Client (NaCl).
</p>
<p><!-- CL 170119, CL 168882 -->
For <code>GOARCH=wasm</code>, the new environment variable <code>GOWASM</code> takes a comma-separated list of experimental features that the binary gets compiled with.
The valid values are documented <a href="/cmd/go/#hdr-Environment_variables">here</a>.
</p>
<h3 id="aix">AIX</h3>
<p><!-- CL 164003, CL 169120 -->
AIX on PPC64 (<code>aix/ppc64</code>) now supports cgo, external
linking, and the <code>c-archive</code> and <code>pie</code> build
modes.
</p>
<h3 id="android">Android</h3>
<p><!-- CL 170127 -->
@ -136,12 +150,16 @@ TODO
build tag.
</p>
<h3 id="aix">AIX</h3>
<h3 id="netbsd">NetBSD</h3>
<p><!-- CL 164003, CL 169120 -->
AIX on PPC64 (<code>aix/ppc64</code>) now supports cgo, external
linking, and the <code>c-archive</code> and <code>pie</code> build
modes.
<p><!--CL 155739 -->
Go now supports NetBSD on arm64.
</p>
<h3 id="openbsd">OpenBSD</h3>
<p><!--CL 174125 -->
Go now supports OpenBSD on arm64.
</p>
<h3 id="windows">Windows</h3>
@ -157,8 +175,246 @@ TODO
<h2 id="tools">Tools</h2>
<h3 id="modules">Modules</h3>
<h4 id="proxy-vars">Environment variables</h4>
<p><!-- CL 176580 -->
The <a href="/cmd/go/#hdr-Module_support"><code>GO111MODULE</code></a>
environment variable continues to default to <code>auto</code>, but
the <code>auto</code> setting now activates the module-aware mode of
the <code>go</code> command whenever the current working directory contains,
or is below a directory containing, a <code>go.mod</code> file — even if the
current directory is within <code>GOPATH/src</code>. This change simplifies
the migration of existing code within <code>GOPATH/src</code> and the ongoing
maintenance of module-aware packages alongside non-module-aware importers.
</p>
<p><!-- CL 181719 -->
The new
<a href="/cmd/go/#hdr-Module_configuration_for_non_public_modules"><code>GOPRIVATE</code></a>
environment variable indicates module paths that are not publicly available.
It serves as the default value for the lower-level <code>GONOPROXY</code>
and <code>GONOSUMDB</code> variables, which provide finer-grained control over
which modules are fetched via proxy and verified using the checksum database.
</p>
<p><!-- CL 173441, CL 177958 -->
The <a href="/cmd/go/#hdr-Module_downloading_and_verification"><code>GOPROXY</code>
environment variable</a> may now be set to a comma-separated list of proxy
URLs or the special token <code>direct</code>, and
its <a href="#introduction">default value</a> is
now <code>https://proxy.golang.org,direct</code>. When resolving a package
path to its containing module, the <code>go</code> command will try all
candidate module paths on each proxy in the list in succession. An unreachable
proxy or HTTP status code other than 404 or 410 terminates the search without
consulting the remaining proxies.
</p>
<p>
TODO
The new
<a href="/cmd/go/#hdr-Module_authentication_failures"><code>GOSUMDB</code></a>
environment variable identifies the name, and optionally the public key and
server URL, of the database to consult for checksums of modules that are not
yet listed in the main module's <code>go.sum</code> file.
If <code>GOSUMDB</code> does not include an explicit URL, the URL is chosen by
probing the <code>GOPROXY</code> URLs for an endpoint indicating support for
the checksum database, falling back to a direct connection to the named
database if it is not supported by any proxy. If <code>GOSUMDB</code> is set
to <code>off</code>, the checksum database is not consulted and only the
existing checksums in the <code>go.sum</code> file are verified.
</p>
<p>
Users who cannot reach the default proxy and checksum database (for example,
due to a firewalled or sandboxed configuration) may disable their use by
setting <code>GOPROXY</code> to <code>direct</code>, and/or
<code>GOSUMDB</code> to <code>off</code>.
<a href="#go-env-w"><code>go</code> <code>env</code> <code>-w</code></a>
can be used to set the default values for these variables independent of
platform:
</p>
<pre>
go env -w GOPROXY=direct
go env -w GOSUMDB=off
</pre>
<h4 id="go-get"><code>go</code> <code>get</code></h4>
<p><!-- CL 174099 -->
In module-aware mode,
<a href="/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them"><code>go</code> <code>get</code></a>
with the <code>-u</code> flag now updates a smaller set of modules that is
more consistent with the set of packages updated by
<code>go</code> <code>get</code> <code>-u</code> in GOPATH mode.
<code>go</code> <code>get</code> <code>-u</code> continues to update the
modules and packages named on the command line, but additionally updates only
the modules containing the packages <em>imported by</em> the named packages,
rather than the transitive module requirements of the modules containing the
named packages.
</p>
<p>
Note in particular that <code>go</code> <code>get</code> <code>-u</code>
(without additional arguments) now updates only the transitive imports of the
package in the current directory. To instead update all of the packages
transitively imported by the main module (including test dependencies), use
<code>go</code> <code>get</code> <code>-u</code> <code>all</code>.
</p>
<p><!-- CL 177879 -->
As a result of the above changes to
<code>go</code> <code>get</code> <code>-u</code>, the
<code>go</code> <code>get</code> subcommand no longer supports
the <code>-m</code> flag, which caused <code>go</code> <code>get</code> to
stop before loading packages. The <code>-d</code> flag remains supported, and
continues to cause <code>go</code> <code>get</code> to stop after downloading
the source code needed to build dependencies of the named packages.
</p>
<p><!-- CL 177677 -->
By default, <code>go</code> <code>get</code> <code>-u</code> in module mode
upgrades only non-test dependencies, as in GOPATH mode. It now also accepts
the <code>-t</code> flag, which (as in GOPATH mode)
causes <code>go</code> <code>get</code> to include the packages imported
by <em>tests of</em> the packages named on the command line.
</p>
<p><!-- CL 167747 -->
In module-aware mode, the <code>go</code> <code>get</code> subcommand now
supports the version suffix <code>@patch</code>. The <code>@patch</code>
suffix indicates that the named module, or module containing the named
package, should be updated to the highest patch release with the same
major and minor versions as the version found in the build list.
</p>
<p><!-- CL 184440 -->
If a module passed as an argument to <code>go</code> <code>get</code>
without a version suffix is already required at a newer version than the
latest released version, it will remain at the newer version. This is
consistent with the behavior of the <code>-u</code> flag for module
dependencies. This prevents unexpected downgrades from pre-release versions.
The new version suffix <code>@upgrade</code> explicitly requests this
behavior. <code>@latest</code> explicitly requests the latest version
regardless of the current version.
</p>
<h4 id="version-validation">Version validation</h4><!-- CL 181881 -->
<p>
When extracting a module from a version control system, the <code>go</code>
command now performs additional validation on the requested version string.
</p>
<p>
The <code>+incompatible</code> version annotation bypasses the requirement
of <a href="/cmd/go/#hdr-Module_compatibility_and_semantic_versioning">semantic
import versioning</a> for repositories that predate the introduction of
modules. The <code>go</code> command now verifies that such a version does not
include an explicit <code>go.mod</code> file.
</p>
<p>
The <code>go</code> command now verifies the mapping
between <a href="/cmd/go/#hdr-Pseudo_versions">pseudo-versions</a> and
version-control metadata. Specifically:
<ul>
<li>The version prefix must be of the form <code>vX.0.0</code>, or derived
from a tag on an ancestor of the named revision, or derived from a tag that
includes <a href="https://semver.org/#spec-item-10">build metadata</a> on
the named revision itself.</li>
<li>The date string must match the UTC timestamp of the revision.</li>
<li>The short name of the revision must use the same number of characters as
what the <code>go</code> command would generate. (For SHA-1 hashes as used
by <code>git</code>, a 12-digit prefix.)</li>
</ul>
</p>
<p>
If a <code>require</code> directive in the
<a href="/cmd/go/#hdr-The_main_module_and_the_build_list">main module</a> uses
an invalid pseudo-version, it can usually be corrected by redacting the
version to just the commit hash and re-running a <code>go</code> command, such
as <code>go</code> <code>list</code> <code>-m</code> <code>all</code>
or <code>go</code> <code>mod</code> <code>tidy</code>. For example,
</p>
<pre>require github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c</pre>
<p>can be redacted to</p>
<pre>require github.com/docker/docker e7b5f7dbe98c</pre>
<p>which currently resolves to</p>
<pre>require github.com/docker/docker v0.7.3-0.20190319215453-e7b5f7dbe98c</pre>
<p>
If one of the transitive dependencies of the main module requires an invalid
version or pseudo-version, the invalid version can be replaced with a valid
one using a
<a href="/cmd/go/#hdr-The_go_mod_file"><code>replace</code> directive</a> in
the <code>go.mod</code> file of the main module. If the replacement is a
commit hash, it will be resolved to the appropriate pseudo-version as above.
For example,
</p>
<pre>replace github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c => github.com/docker/docker e7b5f7dbe98c</pre>
<p>currently resolves to</p>
<pre>replace github.com/docker/docker v1.14.0-0.20190319215453-e7b5f7dbe98c => github.com/docker/docker v0.7.3-0.20190319215453-e7b5f7dbe98c</pre>
<h3 id="go-command">Go command</h3>
<p id="go-env-w"><!-- CL 171137 -->
The <a href="/cmd/go/#hdr-Environment_variables"><code>go</code> <code>env</code></a>
command now accepts a <code>-w</code> flag to set the per-user default value
of an environment variable recognized by the
<code>go</code> command, and a corresponding <code>-u</code> flag to unset a
previously-set default. Defaults set via
<code>go</code> <code>env</code> <code>-w</code> are stored in the
<code>go/env</code> file within
<a href="/pkg/os/#UserConfigDir"><code>os.UserConfigDir()</code></a>.
</p>
<p id="go-version-exe"><!-- CL 173343 -->
The <a href="/cmd/go/#hdr-Print_Go_version">
<code>go</code> <code>version</code></a> command now accepts arguments naming
executables and directories. When invoked on an executable,
<code>go</code> <code>version</code> prints the version of Go used to build
the executable. If the <code>-m</code> flag is used,
<code>go</code> <code>version</code> prints the executable's embedded module
version information, if available. When invoked on a directory,
<code>go</code> <code>version</code> prints information about executables
contained in the directory and its subdirectories.
</p>
<p id="trimpath"><!-- CL 173345 -->
The new <a href="/cmd/go/#hdr-Compile_packages_and_dependencies"><code>go</code>
<code>build</code> flag</a> <code>-trimpath</code> removes all file system paths
from the compiled executable, to improve build reproducibility.
</p>
<p id="o-dir"><!-- CL 167679 -->
If the <code>-o</code> flag passed to <code>go</code> <code>build</code>
refers to an existing directory, <code>go</code> <code>build</code> will now
write executable files within that directory for <code>main</code> packages
matching its package arguments.
</p>
<p id="comma-separated-tags"><!-- CL 173438 -->
The <code>go</code> <code>build</code> flag <code>-tags</code> now takes a
comma-separated list of build tags, to allow for multiple tags in
<a href="/cmd/go/#hdr-Environment_variables"><code>GOFLAGS</code></a>. The
space-separated form is deprecated but still recognized and will be maintained.
</p>
<p id="go-generate-tag"><!-- CL 175983 -->
<a href="/cmd/go/#hdr-Generate_Go_files_by_processing_source"><code>go</code>
<code>generate</code></a> now sets the <code>generate</code> build tag so that
files may be searched for directives but ignored during build.
</p>
<p id="binary-only"><!-- CL 165746 -->
As <a href="/doc/go1.12#binary-only">announced</a> in the Go 1.12 release
notes, binary-only packages are no longer supported. Building a binary-only
package (marked with a <code>//go:binary-only-package</code> comment) now
results in an error.
</p>
<h3 id="compiler">Compiler toolchain</h3>
@ -191,6 +447,41 @@ TODO
introduced in ARM v8.1.
</p>
<h3 id="gofmt">gofmt</h3>
<p>
<code>gofmt</code> (and with that <code>go fmt</code>) now canonicalizes
number literal prefixes and exponents to use lower-case letters, but
leaves hexadecimal digits alone. This improves readability when using the new octal prefix
(<code>0O</code> becomes <code>0o</code>), and the rewrite is applied consistently.
<code>gofmt</code> now also removes unnecessary leading zeroes from a decimal integer
imaginary literal. (For backwards-compatibility, an integer imaginary literal
starting with <code>0</code> is considered a decimal, not an octal number.
Removing superfluous leading zeroes avoids potential confusion.)
For instance, <code>0B1010</code>, <code>0XabcDEF</code>, <code>0O660</code>,
<code>1.2E3</code>, and <code>01i</code> become <code>0b1010</code>, <code>0xabcDEF</code>,
<code>0o660</code>, <code>1.2e3</code>, and <code>1i</code> after applying <code>gofmt</code>.
</p>
<h3 id="godoc"><code>godoc</code> and <code>go</code> <code>doc</code></h3>
<p><!-- CL 174322 -->
The <code>godoc</code> webserver is no longer included in the main binary distribution.
To run the <code>godoc</code> webserver locally, manually install it first:
<pre>
go get golang.org/x/tools/cmd/godoc
godoc
</pre>
</p>
<p><!-- CL 177797 -->
The
<a href="/cmd/go/#hdr-Show_documentation_for_package_or_symbol"><code>go</code> <code>doc</code></a>
command now always includes the package clause in its output, except for
commands. This replaces the previous behavior where a heuristic was used,
causing the package clause to be omitted under certain conditions.
</p>
<h2 id="runtime">Runtime</h2>
<p><!-- CL 161477 -->
@ -217,10 +508,6 @@ TODO
<h2 id="library">Core library</h2>
<p>
TODO generally
</p>
<h3 id="tls_1_3">TLS 1.3</h3>
<p>
@ -246,6 +533,37 @@ TODO generally
<code>crypto/ed25519</code> when used with Go 1.13+.
</p>
<h3 id="error_wrapping">Error wrapping</h3>
<p><!-- CL 163558, 176998 -->
Go 1.13 contains support for error wrapping, as first proposed in
the <a href="https://go.googlesource.com/proposal/+/master/design/29934-error-values.md">
Error Values proposal</a> and discussed on <a href="https://golang.org/issue/29934">the
associated issue</a>.
</p>
<p>
An error <code>e</code> can <em>wrap</em> another error <code>w</code> by providing
an <code>Unwrap</code> method that returns <code>w</code>. Both <code>e</code>
and <code>w</code> are available to programs, allowing <code>e</code> to provide
additional context to <code>w</code> or to reinterpret it while still allowing
programs to make decisions based on <code>w</code>.
</p>
<p>
To support wrapping, <a href="#fmt"><code>fmt.Errorf</code></a> now has a <code>%w</code>
verb for creating wrapped errors, and three new functions in
the <a href="#errors"><code>errors</code></a> package (
<a href="/pkg/errors/#Unwrap"><code>errors.Unwrap</code></a>,
<a href="/pkg/errors/#Is"><code>errors.Is</code></a> and
<a href="/pkg/errors/#As"><code>errors.As</code></a>) simplify unwrapping
and inspecting wrapped errors.
</p>
<p>
For more information, read the <a href="/pkg/errors/"><code>errors</code> package
documentation</a>, or see
the <a href="https://golang.org/wiki/ErrorValueFAQ">Error Value FAQ</a>.
There will soon be a blog post as well.
</p>
<h3 id="minor_library_changes">Minor changes to the library</h3>
<p>
@ -254,23 +572,8 @@ TODO generally
in mind.
</p>
<p>
TODO
</p>
<!-- CL 174125: https://golang.org/cl/174125: cmd/dist: add support for openbsd/arm64 -->
<!-- CL 177797: https://golang.org/cl/177797: cmd/doc: always print package clause except for commands -->
<!-- CL 173345: https://golang.org/cl/173345: cmd/go: add -trimpath build flag -->
<!-- CL 173438: https://golang.org/cl/173438: cmd/go: change -tags to a comma-separated list -->
<!-- CL 175983: https://golang.org/cl/175983: cmd/go: set the "generate" build tag in go generate, per design doc -->
<!-- CL 167747: https://golang.org/cl/167747: 'go get' in module mode now supports the version suffix '@patch'.: cmd/go/internal/modget: support the suffix '@patch' in 'go get' -->
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
<dd>
<p><!-- CL 161760 -->
TODO: <a href="https://golang.org/cl/161760">https://golang.org/cl/161760</a>: hoist error creation out of function
</p>
<p>
The new <a href="/pkg/bytes/#ToValidUTF8"><code>ToValidUTF8</code></a> function returns a
copy of a given byte slice with each run of invalid UTF-8 byte sequences replaced by a given slice.
@ -288,6 +591,19 @@ TODO
<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
<dd>
<p>
Support for SSL version 3.0 (SSLv3) <a href="https://golang.org/issue/32716">
is now deprecated and will be removed in Go 1.14</a>. Note that SSLv3 is the
<a href="https://tools.ietf.org/html/rfc7568">cryptographically broken</a>
protocol predating TLS.
</p>
<p>
SSLv3 was always disabled by default, other than in Go 1.12, when it was
mistakenly enabled by default server-side. It is now again disabled by
default. (SSLv3 was never supported client-side.)
</p>
<p><!-- CL 177698 -->
Ed25519 certificates are now supported in TLS versions 1.2 and 1.3.
</p>
@ -304,6 +620,11 @@ TODO
and <a href="/pkg/crypto/x509/#ParsePKIXPublicKey"><code>ParsePKIXPublicKey</code></a> functions.
</p>
<p><!-- CL 169238 -->
The paths searched for system roots now include <code>/etc/ssl/cert.pem</code>
to support the default location in Alpine Linux 3.7+.
</p>
</dl><!-- crypto/x509 -->
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
@ -331,11 +652,83 @@ TODO
</dl><!-- debug/dwarf -->
<dl id="errors"><dt><a href="/pkg/errors/">errors</a></dt>
<dd>
<!-- CL 163558 -->
<p>
The new function <a href="/pkg/errors/#As"><code>As</code></a> finds the first
error in a given errors chain (sequence of wrapped errors)
that matches a given targets type, and if so, sets the target to that error value.
</p>
<p>
The new function <a href="/pkg/errors/#Is"><code>Is</code></a> reports whether a given error value matches an
error in anothers chain.
</p>
<p>
The new function <a href="/pkg/errors/#Unwrap"><code>Unwrap</code></a> returns the result of calling
<code>Unwrap</code> on a given error, if one exists.
</p>
</dl><!-- errors -->
<dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
<dd>
<!-- CL 160245 -->
<p>
The printing verbs <code>%x</code> and <code>%X</code> now format floating-point and
complex numbers in hexadecimal notation, in lower-case and upper-case respectively.
</p>
<!-- CL 160246 -->
<p>
The new printing verb <code>%O</code> formats integers in base 8, emitting the <code>0o</code> prefix.
</p>
<!-- CL 160247 -->
<p>
The scanner now accepts hexadecimal floating-point values, digit-separating underscores
and leading <code>0b</code> and <code>0o</code> prefixes.
See the <a href="#language">Changes to the language</a> for details.
</p>
<!-- CL 176998 -->
<p>The <a href="/pkg/fmt/#Errorf"><code>Errorf</code></a> function
has a new verb, <code>%w</code>, whose operand must be an error.
The error returned from <code>Errorf</code> will have an
<code>Unwrap</code> method which returns the operand of <code>%w</code>.
</p>
</dl><!-- fmt -->
<dl id="go/scanner"><dt><a href="/pkg/go/scanner/">go/scanner</a></dt>
<dd>
<p><!-- CL 175218 -->
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with <code>0b</code>/<code>0B</code> prefix, octal literals with <code>0o</code>/<code>0O</code> prefix,
and floating-point numbers with hexadecimal mantissa. The imaginary suffix <code>i</code> may now be used with any number
literal, and underscores may used as digit separators for grouping.
See the <a href="#language">Changes to the language</a> for details.
</p>
</dl><!-- go/scanner -->
<dl id="go/types"><dt><a href="/pkg/go/types/">go/types</a></dt>
<dd>
<p>
The type-checker has been updated to follow the new rules for integer shifts.
See the <a href="#language">Changes to the language</a> for details.
</p>
</dl><!-- go/types -->
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
<dd>
<p><!-- CL 175218 -->
When using a <code>&lt;script&gt;</code> tag with "module" set as the
type attribute, code will now be interperted as <a href="https://html.spec.whatwg.org/multipage/scripting.html#the-script-element:module-script-2">JavaScript module script</a>.
type attribute, code will now be interpreted as <a href="https://html.spec.whatwg.org/multipage/scripting.html#the-script-element:module-script-2">JavaScript module script</a>.
</p>
</dl><!-- html/template -->
@ -351,11 +744,23 @@ TODO
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
<dd>
<p><!-- CL 160682 -->
TODO: <a href="https://golang.org/cl/160682">https://golang.org/cl/160682</a>: implement Rat.SetUint64
The new <a href="/pkg/math/big/#Rat.SetUint64"><code>Rat.SetUint64</code></a> method sets the <code>Rat</code> to a <code>uint64</code> value.
</p>
<p><!-- CL 166157 -->
For <a href="/pkg/math/big/#Float.Parse"><code>Float.Parse</code></a>, if base is 0, underscores
may be used between digits for readability.
See the <a href="#language">Changes to the language</a> for details.
</p>
<p><!-- CL 166157 -->
For <a href="/pkg/math/big/#Int.SetString"><code>Int.SetString</code></a>, if base is 0, underscores
may be used between digits for readability.
See the <a href="#language">Changes to the language</a> for details.
</p>
<p><!-- CL 168237 -->
TODO: <a href="https://golang.org/cl/168237">https://golang.org/cl/168237</a>: accept non-decimal floats with Rat.SetString
<a href="/pkg/math/big/#Rat.SetString"><code>Rat.SetString</code></a> now accepts non-decimal floating point representations.
</p>
</dl><!-- math/big -->
@ -382,12 +787,37 @@ TODO
<p><!-- CL 170678 -->
The new field <a href="/pkg/net/#ListenConfig.KeepAlive"><code>ListenConfig.KeepAlive</code></a>
specifies the keep-alive period for network connections accepted by the listener.
If this field is 0 (the default) TCP keep-alives will be enabled.
To disable them, set it to a negative value.
</p>
<p>
Note that the error returned from I/O on a connection that was
closed by a keep-alive timeout will have a
<code>Timeout</code> method that returns <code>true</code> if called.
This can make a keep-alive error difficult to distinguish from
an error returned due to a missed deadline as set by the
<a href="/pkg/net/#Conn"><code>SetDeadline</code></a>
method and similar methods.
Code that uses deadlines and checks for them with
the <code>Timeout</code> method or
with <a href="/pkg/os/#IsTimeout"><code>os.IsTimeout</code></a>
may want to disable keep-alives, or
use <code>errors.Is(syscall.ETIMEDOUT)</code> (on Unix systems)
which will return true for a keep-alive timeout and false for a
deadline timeout.
</p>
</dl><!-- net -->
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
<dd>
<p><!-- CL 76410 -->
The new fields <a href="/pkg/net/http/#Transport.WriteBufferSize"><code>Transport.WriteBufferSize</code></a>
and <a href="/pkg/net/http/#Transport.ReadBufferSize"><code>Transport.ReadBufferSize</code></a>
allow one to specify the sizes of the write and read buffers for a <a href="/pkg/net/http/#Transport"><code>Transport</code></a>.
If either field is zero, a default size of 4KB is used.
</p>
<p><!-- CL 130256 -->
The new field <a href="/pkg/net/http/#Transport.ForceAttemptHTTP2"><code>Transport.ForceAttemptHTTP2</code></a>
controls whether HTTP/2 is enabled when a non-zero <code>Dial</code>, <code>DialTLS</code>, or <code>DialContext</code>
@ -395,7 +825,7 @@ TODO
</p>
<p><!-- CL 140357 -->
When reusing HTTP/2, the <a href="/pkg/net/http#Transport"><code>Transport</code></a> no longer performs unnecessary TLS handshakes.
When reusing HTTP/2, the <a href="/pkg/net/http/#Transport"><code>Transport</code></a> no longer performs unnecessary TLS handshakes.
</p>
<p><!-- CL 154383 -->
@ -404,11 +834,29 @@ TODO
<a href="/pkg/net/http/#Pusher"><code>Pusher</code></a> and <a href="/pkg/net/http/#Flusher"><code>Flusher</code></a> interfaces.
</p>
<p><!-- CL 157339 -->
The <code>StatusCode</code> <code>103</code> <code>"Early Hints"</code> has been added.
</p>
<p><!-- CL 163599 -->
<a href="/pkg/net/http/#Transport"><code>Transport</code></a> now uses the <a href="/pkg/net/http/#Request.Body"><code>Request.Body</code></a>'s
<a href="/pkg/io/#ReaderFrom"><code>io.ReaderFrom</code></a> implementation if available, to optimize writing the body.
</p>
<p><!-- CL 167017 -->
On encountering unsupported transfer-encodings, <a href="/pkg/net/http/#Server"><code>http.Server</code></a> now
returns a "501 Unimplemented" status as mandated by the HTTP specification <a href="https://tools.ietf.org/html/rfc7230#section-3.3.1">RFC 7230 Section 3.3.1</a>.
</p>
<p><!-- CL 167681 -->
The new <a href="/pkg/net/http#Server"><code>Server</code></a> fields
The new <a href="/pkg/net/http/#Server"><code>Server</code></a> fields
<a href="/pkg/net/http/#Server.BaseContext"><code>BaseContext</code></a> and
<a href="/pkg/net/http/#Server.ConnContext"><code>ConnContext</code></a>
allow finer control over the <a href="/pkg/context#Context"><code>Context</code></a> values provided to requests and connections.
allow finer control over the <a href="/pkg/context/#Context"><code>Context</code></a> values provided to requests and connections.
</p>
<p><!-- CL 167781 -->
<a href="/pkg/net/http/#DetectContentType"><code>http.DetectContentType</code></a> now correctly detects RAR signatures, and can now also detect RAR v5 signatures.
</p>
<p><!-- CL 173658 -->
@ -416,6 +864,17 @@ TODO
<a href="/pkg/net/http/#Header.Clone"><code>Clone</code></a> returns a copy of the receiver.
</p>
<p><!-- CL 174324 -->
A new function <a href="/pkg/net/http/#NewRequestWithContext"><code>NewRequestWithContext</code></a> has been added and it
accepts a <a href="/pkg/context/#Context"><code>Context</code></a> that controls the entire lifetime of
the created outgoing <a href="/pkg/net/http/#Request"><code>Request</code></a>, suitable for use with
<a href="/pkg/net/http/#Client.Do"><code>Client.Do</code></a> and <a href="/pkg/net/http/#Transport.RoundTrip"><code>Transport.RoundTrip</code></a>.
</p>
<p><!-- CL 179457 -->
<a href="/pkg/net/http/#Transport"><code>Transport</code></a> now silently ignores a <code>408 "Request Timeout"</code> response.
</p>
</dl><!-- net/http -->
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
@ -435,9 +894,9 @@ TODO
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
<dd>
<p><!-- CL 174318 -->
On Windows, the environment for a <a href="/pkg/os/exec#Cmd"><code>Cmd</code></a> always inherits the
On Windows, the environment for a <a href="/pkg/os/exec/#Cmd"><code>Cmd</code></a> always inherits the
<code>%SYSTEMROOT%</code> value of the parent process unless the
<a href="/pkg/os/exec#Cmd.Env"><code>Cmd.Env</code></a> field includes an explicit value for it.
<a href="/pkg/os/exec/#Cmd.Env"><code>Cmd.Env</code></a> field includes an explicit value for it.
</p>
</dl><!-- os/exec -->
@ -457,15 +916,27 @@ TODO
<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
<dd>
<p> <!-- CL 167780 -->
Tracebacks, <code>runtime.Caller</code>,
and <code>runtime.Callers</code> now refer to the function that
Tracebacks, <a href="/pkg/runtime/#Caller"><code>runtime.Caller</code></a>,
and <a href="/pkg/runtime/#Callers"><code>runtime.Callers</code></a> now refer to the function that
initializes the global variables of <code>PKG</code>
as <code>PKG.init</code> instead of <code>PKG.init.ializers</code>
as <code>PKG.init</code> instead of <code>PKG.init.ializers</code>.
</p>
</dl><!-- runtime -->
<dl id="strings"><dt><a href="/pkg/strings">strings</a></dt>
<dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
<dd>
<p><!-- CL 160243 -->
For <a href="/pkg/strconv/#ParseFloat"><code>strconv.ParseFloat</code></a>,
<a href="/pkg/strconv/#ParseInt"><code>strconv.ParseInt</code></a>
and <a href="/pkg/strconv/#ParseUint"><code>strconv.ParseUint</code></a>,
if base is 0, underscores may be used between digits for readability.
See the <a href="#language">Changes to the language</a> for details.
</p>
</dl><!-- strconv -->
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
<dd>
<p><!-- CL 142003 -->
The new <a href="/pkg/strings/#ToValidUTF8"><code>ToValidUTF8</code></a> function returns a
@ -476,6 +947,14 @@ TODO
<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
<dd>
<p><!-- CL 148958, CL 148959, CL 152697, CL 152698 -->
The fast paths of <a href="/pkg/sync/#Mutex.Lock"><code>Mutex.Lock</code></a>, <a href="/pkg/sync/#Mutex.Unlock"><code>Mutex.Unlock</code></a>,
<a href="/pkg/sync/#RWMutex.Lock"><code>RWMutex.Lock</code></a>, <a href="/pkg/sync/#Mutex.RUnlock"><code>RWMutex.RUnlock</code></a>, and
<a href="/pkg/sync/#Once.Do"><code>Once.Do</code></a> are now inlined in their callers.
For the uncontended cases on amd64, these changes make <a href="/pkg/sync/#Once.Do"><code>Once.Do</code></a> twice as fast, and the
<a href="/pkg/sync/#Mutex"><code>Mutex</code></a>/<a href="/pkg/sync/#RWMutex"><code>RWMutex</code></a> methods up to 10% faster.
</p>
<p><!-- CL 166960 -->
Large <a href="/pkg/sync/#Pool"><code>Pool</code></a> no longer increase stop-the-world pause times.
</p>
@ -490,8 +969,9 @@ TODO
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
<dd>
<p><!-- CL 168479 -->
Uses of <code>_getdirentries64</code> have been removed from Darwin builds, to allow binaries
built with 1.12 to be uploaded to the macOS App Store.
Uses of <code>_getdirentries64</code> have been removed from
Darwin builds, to allow Go binaries to be uploaded to the macOS
App Store.
</p>
<p><!-- CL 174197 -->
@ -505,12 +985,19 @@ TODO
<a href="/pkg/syscall/?GOOS=windows#Chmod"><code>Chmod</code></a> mode on Windows.
</p>
<p><!-- CL 191337 -->
Values of type <code>Errno</code> can be tested against error values in
the <code>os</code> package,
like <a href="/pkg/os/#ErrExist"><code>ErrExist</code></a>, using
<a href="/pkg/errors/#Is"><code>errors.Is</code></a>.
</p>
</dl><!-- syscall -->
<dl id="syscall/js"><dt><a href="/pkg/syscall/js/">syscall/js</a></dt>
<dd>
<p><!-- CL 177537 -->
<a href="/pkg/syscall/js/#TypedArray"><code>TypedArrayOf</code></a> has been replaced by
TypedArrayOf has been replaced by
<a href="/pkg/syscall/js/#CopyBytesToGo"><code>CopyBytesToGo</code></a> and
<a href="/pkg/syscall/js/#CopyBytesToJS"><code>CopyBytesToJS</code></a> for copying bytes between a byte slice and a Uint8Array.
</p>
@ -520,24 +1007,32 @@ TODO
<dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
<dd>
<p><!-- CL 112155 -->
TODO: <a href="https://golang.org/cl/112155">https://golang.org/cl/112155</a>: stop rounding b.N
When running benchmarks, <a href="/pkg/testing/#B.N"><code>B.N</code></a> is no longer rounded.
</p>
<p><!-- CL 166717 -->
TODO: <a href="https://golang.org/cl/166717">https://golang.org/cl/166717</a>: add B.ReportMetric for custom benchmark metrics
The new method <a href="/pkg/testing/#B.ReportMetric"><code>B.ReportMetric</code></a> lets users report
custom benchmark metrics and override built-in metrics.
</p>
<p><!-- CL 173722 -->
TODO: <a href="https://golang.org/cl/173722">https://golang.org/cl/173722</a>: delay flag registration; move to an Init function
Testing flags are now registered in the new <a href="/pkg/testing/#Init"><code>Init</code></a> function,
which is invoked by the generated <code>main</code> function for the test.
As a result, testing flags are now only registered when running a test binary,
and packages that call <code>flag.Parse</code> during package initialization may cause tests to fail.
</p>
</dl><!-- testing -->
<dl id="text/scanner"><dt><a href="/pkg/text/scanner/">text/scanner</a></dt>
<dd>
<p><!-- CL 163079 -->
The new <a href="/pkg/text/scanner/#AllowNumberbars"><code>AllowNumberbars</code></a>
mode allows number literals to contain underbars as digit separators.
<p><!-- CL 183077 -->
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with <code>0b</code>/<code>0B</code> prefix, octal literals with <code>0o</code>/<code>0O</code> prefix,
and floating-point numbers with hexadecimal mantissa.
Also, the new <a href="/pkg/text/scanner/#AllowDigitSeparators"><code>AllowDigitSeparators</code></a>
mode allows number literals to contain underscores as digit separators (off by default for backwards-compatibility).
See the <a href="#language">Changes to the language</a> for details.
</p>
</dl><!-- text/scanner -->
@ -554,7 +1049,7 @@ TODO
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
<dd>
<p><!-- CL 122876 -->
Day-of-year is now supported by <a href="/pkg/time/#time.Format"><code>Format</code></a>
Day-of-year is now supported by <a href="/pkg/time/#Time.Format"><code>Format</code></a>
and <a href="/pkg/time/#Parse"><code>Parse</code></a>.
</p>
@ -567,3 +1062,13 @@ TODO
</dl><!-- time -->
<dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
<dd>
<p>
The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
support throughout the system has been upgraded from Unicode 10.0 to
<a href="http://www.unicode.org/versions/Unicode11.0.0/">Unicode 11.0</a>,
which adds 684 new characters, including seven new scripts, and 66 new emoji.
</p>
</dl><!-- unicode -->

View file

@ -373,7 +373,7 @@ which can be useful information when debugging deadlocks or performance issues.
<p>
A new package <a href="/pkg/debug/plan9obj/"><code>debug/plan9obj</code></a> was added to the standard library.
It implements access to Plan 9 <a href="http://plan9.bell-labs.com/magic/man2html/6/a.out">a.out</a> object files.
It implements access to Plan 9 <a href="https://9p.io/magic/man2html/6/a.out">a.out</a> object files.
</p>
<h3 id="major_library_changes">Major changes to the library</h3>

View file

@ -10,7 +10,7 @@ Edit .,s;^([a-z][A-Za-z0-9_/]+)\.([A-Z][A-Za-z0-9_]+\.)?([A-Z][A-Za-z0-9_]+)([ .
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.6</h2>

View file

@ -22,7 +22,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.7</h2>

View file

@ -12,7 +12,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.8</h2>

View file

@ -12,7 +12,7 @@ Do not send CLs removing the interior tags from such phrases.
-->
<style>
ul li { margin: 0.5em 0; }
main ul li { margin: 0.5em 0; }
</style>
<h2 id="introduction">Introduction to Go 1.9</h2>

View file

@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of May 14, 2019",
"Subtitle": "Version of Aug 26, 2019",
"Path": "/ref/spec"
}-->
@ -1244,24 +1244,36 @@ The value of an uninitialized variable of interface type is <code>nil</code>.
</p>
<pre class="ebnf">
InterfaceType = "interface" "{" { MethodSpec ";" } "}" .
MethodSpec = MethodName Signature | InterfaceTypeName .
InterfaceType = "interface" "{" { ( MethodSpec | InterfaceTypeName ) ";" } "}" .
MethodSpec = MethodName Signature .
MethodName = identifier .
InterfaceTypeName = TypeName .
</pre>
<p>
As with all method sets, in an interface type, each method must have a
<a href="#Uniqueness_of_identifiers">unique</a>
non-<a href="#Blank_identifier">blank</a> name.
An interface type may specify methods <i>explicitly</i> through method specifications,
or it may <i>embed</i> methods of other interfaces through interface type names.
</p>
<pre>
// A simple File interface
// A simple File interface.
interface {
Read(b Buffer) bool
Write(b Buffer) bool
Close()
Read([]byte) (int, error)
Write([]byte) (int, error)
Close() error
}
</pre>
<p>
The name of each explicitly specified method must be <a href="#Uniqueness_of_identifiers">unique</a>
and not <a href="#Blank_identifier">blank</a>.
</p>
<pre>
interface {
String() string
String() string // illegal: String not unique
_(x int) // illegal: method must have non-blank name
}
</pre>
@ -1272,9 +1284,9 @@ have the method set
</p>
<pre>
func (p T) Read(b Buffer) bool { return … }
func (p T) Write(b Buffer) bool { return … }
func (p T) Close() { … }
func (p T) Read(p []byte) (n int, err error)
func (p T) Write(p []byte) (n int, err error)
func (p T) Close() error
</pre>
<p>
@ -1324,27 +1336,41 @@ as the <code>File</code> interface.
<p>
An interface <code>T</code> may use a (possibly qualified) interface type
name <code>E</code> in place of a method specification. This is called
<i>embedding</i> interface <code>E</code> in <code>T</code>; it adds
all (exported and non-exported) methods of <code>E</code> to the interface
<code>T</code>.
<i>embedding</i> interface <code>E</code> in <code>T</code>.
The <a href="#Method_sets">method set</a> of <code>T</code> is the <i>union</i>
of the method sets of <code>T</code>s explicitly declared methods and of
<code>T</code>s embedded interfaces.
</p>
<pre>
type Reader interface {
Read(p []byte) (n int, err error)
Close() error
}
type Writer interface {
Write(p []byte) (n int, err error)
Close() error
}
// ReadWriter's methods are Read, Write, and Close.
type ReadWriter interface {
Read(b Buffer) bool
Write(b Buffer) bool
Reader // includes methods of Reader in ReadWriter's method set
Writer // includes methods of Writer in ReadWriter's method set
}
</pre>
type File interface {
ReadWriter // same as adding the methods of ReadWriter
Locker // same as adding the methods of Locker
Close()
}
<p>
A <i>union</i> of method sets contains the (exported and non-exported)
methods of each method set exactly once, and methods with the
<a href="#Uniqueness_of_identifiers">same</a> names must
have <a href="#Type_identity">identical</a> signatures.
</p>
type LockedFile interface {
Locker
File // illegal: Lock, Unlock not unique
Lock() // illegal: Lock not unique
<pre>
type ReadCloser interface {
Reader // includes methods of Reader in ReadCloser's method set
Close() // illegal: signatures of Reader.Close and Close are different
}
</pre>

View file

@ -33,7 +33,7 @@ compiler using the GCC back end, see
</p>
<p>
The Go compilers support eight instruction sets.
The Go compilers support nine instruction sets.
There are important differences in the quality of the compilers for the different
architectures.
</p>
@ -87,6 +87,12 @@ architectures.
<dd>
Supports Linux binaries. New in 1.7 and not as well exercised as other ports.
</dd>
<dt>
<code>wasm</code> (WebAssembly)
</dt>
<dd>
Targets the WebAssembly platform. New in 1.11 and not as well exercised as other ports.
</dd>
</dl>
<p>
@ -134,12 +140,16 @@ For example, <code>$GOROOT_BOOTSTRAP/bin/go</code> should be
the <code>go</code> command binary for the bootstrap toolchain.
</p>
<h3 id="bootstrapFromBinaryRelease">Bootstrap toolchain from binary release</h3>
<p>
To use a binary release as a bootstrap toolchain, see
<a href="/dl/">the downloads page</a> or use any other
packaged Go distribution.
</p>
<h3 id="bootstrapFromSource">Bootstrap toolchain from source</h3>
<p>
To build a bootstrap toolchain from source, use
either the git branch <code>release-branch.go1.4</code> or
@ -153,6 +163,17 @@ the environment, and run <code>make.bash</code> (or,
on Windows, <code>make.bat</code>).
</p>
<p>
Once the Go 1.4 source has been unpacked into your GOROOT_BOOTSTRAP directory,
you must keep this git clone instance checked out to branch
<code>release-branch.go1.4</code>. Specifically, do not attempt to reuse
this git clone in the later step named "Fetch the repository." The go1.4
bootstrap toolchain <b>must be able</b> to properly traverse the go1.4 sources
that it assumes are present under this repository root.
</p>
<h3 id="bootstrapFromCrosscompiledSource">Bootstrap toolchain from cross-compiled source</h3>
<p>
To cross-compile a bootstrap toolchain from source, which is
necessary on systems Go 1.4 did not target (for
@ -175,6 +196,8 @@ That tree can be copied to a machine of the given target type
and used as <code>GOROOT_BOOTSTRAP</code> to bootstrap a local build.
</p>
<h3 id="bootstrapFromGccgo">Bootstrap toolchain using gccgo</h3>
<p>
To use gccgo as the bootstrap toolchain, you need to arrange
for <code>$GOROOT_BOOTSTRAP/bin/go</code> to be the go tool that comes
@ -240,6 +263,11 @@ that if Go is checked out in <code>$HOME/go</code>, it will conflict with
the default location of <code>$GOPATH</code>.
See <a href="#gopath"><code>GOPATH</code></a> below.</p>
Reminder: If you opted to also compile the bootstrap binaries from source (in an
earlier section), you still need to <code>git clone</code> again at this point
(to checkout the latest <code>&lt;tag&gt;</code>), because you must keep your
go1.4 repository distinct.
<h2 id="head">(Optional) Switch to the master branch</h2>
<p>If you intend to modify the go source code, and
@ -493,25 +521,45 @@ These default to the values of <code>$GOHOSTOS</code> and
<p>
Choices for <code>$GOOS</code> are
<code>darwin</code> (macOS 10.10 and above and iOS), <code>dragonfly</code>, <code>freebsd</code>,
<code>android</code>, <code>darwin</code> (macOS 10.11 and above and iOS),
<code>dragonfly</code>, <code>freebsd</code>, <code>illumos</code>, <code>js</code>,
<code>linux</code>, <code>netbsd</code>, <code>openbsd</code>,
<code>plan9</code>, <code>solaris</code> and <code>windows</code>.
</p>
<p>
Choices for <code>$GOARCH</code> are
<code>amd64</code> (64-bit x86, the most mature port),
<code>386</code> (32-bit x86), <code>arm</code> (32-bit ARM), <code>arm64</code> (64-bit ARM),
<code>ppc64le</code> (PowerPC 64-bit, little-endian), <code>ppc64</code> (PowerPC 64-bit, big-endian),
<code>mips64le</code> (MIPS 64-bit, little-endian), <code>mips64</code> (MIPS 64-bit, big-endian),
<code>mipsle</code> (MIPS 32-bit, little-endian), <code>mips</code> (MIPS 32-bit, big-endian), and
<code>s390x</code> (IBM System z 64-bit, big-endian).
<code>mipsle</code> (MIPS 32-bit, little-endian), <code>mips</code> (MIPS 32-bit, big-endian),
<code>s390x</code> (IBM System z 64-bit, big-endian), and
<code>wasm</code> (WebAssembly 32-bit).
</p>
<p>
The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
<table cellpadding="0">
<tr>
<th width="50"></th><th align="left" width="100"><code>$GOOS</code></th> <th align="left" width="100"><code>$GOARCH</code></th>
</tr>
<tr>
<td></td><td><code>aix</code></td> <td><code>ppc64</code></td>
</tr>
<tr>
<td></td><td><code>android</code></td> <td><code>386</code></td>
</tr>
<tr>
<td></td><td><code>android</code></td> <td><code>amd64</code></td>
</tr>
<tr>
<td></td><td><code>android</code></td> <td><code>arm</code></td>
</tr>
<tr>
<td></td><td><code>android</code></td> <td><code>arm64</code></td>
</tr>
<tr>
<td></td><td><code>darwin</code></td> <td><code>386</code></td>
</tr>
<tr>
@ -536,6 +584,12 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
<td></td><td><code>freebsd</code></td> <td><code>arm</code></td>
</tr>
<tr>
<td></td><td><code>illumos</code></td> <td><code>amd64</code></td>
</tr>
<tr>
<td></td><td><code>js</code></td> <td><code>wasm</code></td>
</tr>
<tr>
<td></td><td><code>linux</code></td> <td><code>386</code></td>
</tr>
<tr>
@ -587,12 +641,18 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
<td></td><td><code>openbsd</code></td> <td><code>arm</code></td>
</tr>
<tr>
<td></td><td><code>openbsd</code></td> <td><code>arm64</code></td>
</tr>
<tr>
<td></td><td><code>plan9</code></td> <td><code>386</code></td>
</tr>
<tr>
<td></td><td><code>plan9</code></td> <td><code>amd64</code></td>
</tr>
<tr>
<td></td><td><code>plan9</code></td> <td><code>arm</code></td>
</tr>
<tr>
<td></td><td><code>solaris</code></td> <td><code>amd64</code></td>
</tr>
<tr>

View file

@ -8,8 +8,8 @@
# Consult https://www.iana.org/time-zones for the latest versions.
# Versions to use.
CODE=2018i
DATA=2018i
CODE=2019b
DATA=2019b
set -e
rm -rf work

Binary file not shown.

View file

@ -112,6 +112,7 @@ func TestReportsTypeErrors(t *testing.T) {
"issue18452.go",
"issue18889.go",
"issue28721.go",
"issue33061.go",
} {
check(t, file)
}

View file

@ -156,8 +156,8 @@ var ptrTests = []ptrTest{
// Storing a Go pointer into C memory should fail.
name: "barrier",
c: `#include <stdlib.h>
char **f14a() { return malloc(sizeof(char*)); }
void f14b(char **p) {}`,
char **f14a() { return malloc(sizeof(char*)); }
void f14b(char **p) {}`,
body: `p := C.f14a(); *p = new(C.char); C.f14b(p)`,
fail: true,
expensive: true,
@ -167,9 +167,9 @@ var ptrTests = []ptrTest{
// large value should fail.
name: "barrierstruct",
c: `#include <stdlib.h>
struct s15 { char *a[10]; };
struct s15 *f15() { return malloc(sizeof(struct s15)); }
void f15b(struct s15 *p) {}`,
struct s15 { char *a[10]; };
struct s15 *f15() { return malloc(sizeof(struct s15)); }
void f15b(struct s15 *p) {}`,
body: `p := C.f15(); p.a = [10]*C.char{new(C.char)}; C.f15b(p)`,
fail: true,
expensive: true,
@ -179,9 +179,9 @@ var ptrTests = []ptrTest{
// copy should fail.
name: "barrierslice",
c: `#include <stdlib.h>
struct s16 { char *a[10]; };
struct s16 *f16() { return malloc(sizeof(struct s16)); }
void f16b(struct s16 *p) {}`,
struct s16 { char *a[10]; };
struct s16 *f16() { return malloc(sizeof(struct s16)); }
void f16b(struct s16 *p) {}`,
body: `p := C.f16(); copy(p.a[:], []*C.char{new(C.char)}); C.f16b(p)`,
fail: true,
expensive: true,
@ -191,9 +191,9 @@ var ptrTests = []ptrTest{
// different code path.
name: "barriergcprogarray",
c: `#include <stdlib.h>
struct s17 { char *a[32769]; };
struct s17 *f17() { return malloc(sizeof(struct s17)); }
void f17b(struct s17 *p) {}`,
struct s17 { char *a[32769]; };
struct s17 *f17() { return malloc(sizeof(struct s17)); }
void f17b(struct s17 *p) {}`,
body: `p := C.f17(); p.a = [32769]*C.char{new(C.char)}; C.f17b(p)`,
fail: true,
expensive: true,
@ -202,10 +202,10 @@ var ptrTests = []ptrTest{
// Similar case, with a source on the heap.
name: "barriergcprogarrayheap",
c: `#include <stdlib.h>
struct s18 { char *a[32769]; };
struct s18 *f18() { return malloc(sizeof(struct s18)); }
void f18b(struct s18 *p) {}
void f18c(void *p) {}`,
struct s18 { char *a[32769]; };
struct s18 *f18() { return malloc(sizeof(struct s18)); }
void f18b(struct s18 *p) {}
void f18c(void *p) {}`,
imports: []string{"unsafe"},
body: `p := C.f18(); n := &[32769]*C.char{new(C.char)}; p.a = *n; C.f18b(p); n[0] = nil; C.f18c(unsafe.Pointer(n))`,
fail: true,
@ -215,10 +215,10 @@ var ptrTests = []ptrTest{
// A GC program with a struct.
name: "barriergcprogstruct",
c: `#include <stdlib.h>
struct s19a { char *a[32769]; };
struct s19b { struct s19a f; };
struct s19b *f19() { return malloc(sizeof(struct s19b)); }
void f19b(struct s19b *p) {}`,
struct s19a { char *a[32769]; };
struct s19b { struct s19a f; };
struct s19b *f19() { return malloc(sizeof(struct s19b)); }
void f19b(struct s19b *p) {}`,
body: `p := C.f19(); p.f = C.struct_s19a{[32769]*C.char{new(C.char)}}; C.f19b(p)`,
fail: true,
expensive: true,
@ -227,11 +227,11 @@ var ptrTests = []ptrTest{
// Similar case, with a source on the heap.
name: "barriergcprogstructheap",
c: `#include <stdlib.h>
struct s20a { char *a[32769]; };
struct s20b { struct s20a f; };
struct s20b *f20() { return malloc(sizeof(struct s20b)); }
void f20b(struct s20b *p) {}
void f20c(void *p) {}`,
struct s20a { char *a[32769]; };
struct s20b { struct s20a f; };
struct s20b *f20() { return malloc(sizeof(struct s20b)); }
void f20b(struct s20b *p) {}
void f20c(void *p) {}`,
imports: []string{"unsafe"},
body: `p := C.f20(); n := &C.struct_s20a{[32769]*C.char{new(C.char)}}; p.f = *n; C.f20b(p); n.a[0] = nil; C.f20c(unsafe.Pointer(n))`,
fail: true,
@ -242,7 +242,7 @@ var ptrTests = []ptrTest{
name: "export1",
c: `extern unsigned char *GoFn21();`,
support: `//export GoFn21
func GoFn21() *byte { return new(byte) }`,
func GoFn21() *byte { return new(byte) }`,
body: `C.GoFn21()`,
fail: true,
},
@ -250,17 +250,17 @@ var ptrTests = []ptrTest{
// Returning a C pointer is fine.
name: "exportok",
c: `#include <stdlib.h>
extern unsigned char *GoFn22();`,
extern unsigned char *GoFn22();`,
support: `//export GoFn22
func GoFn22() *byte { return (*byte)(C.malloc(1)) }`,
func GoFn22() *byte { return (*byte)(C.malloc(1)) }`,
body: `C.GoFn22()`,
},
{
// Passing a Go string is fine.
name: "passstring",
c: `#include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } gostring23;
gostring23 f23(gostring23 s) { return s; }`,
typedef struct { const char *p; ptrdiff_t n; } gostring23;
gostring23 f23(gostring23 s) { return s; }`,
imports: []string{"unsafe"},
body: `s := "a"; r := C.f23(*(*C.gostring23)(unsafe.Pointer(&s))); if *(*string)(unsafe.Pointer(&r)) != s { panic(r) }`,
},
@ -279,12 +279,12 @@ var ptrTests = []ptrTest{
c: `extern void f25();`,
imports: []string{"strings"},
support: `//export GoStr25
func GoStr25() string { return strings.Repeat("a", 2) }`,
func GoStr25() string { return strings.Repeat("a", 2) }`,
body: `C.f25()`,
c1: `#include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } gostring25;
extern gostring25 GoStr25();
void f25() { GoStr25(); }`,
typedef struct { const char *p; ptrdiff_t n; } gostring25;
extern gostring25 GoStr25();
void f25() { GoStr25(); }`,
fail: true,
},
{
@ -295,7 +295,7 @@ var ptrTests = []ptrTest{
// that is, we are testing something that is not unsafe.
name: "ptrdata1",
c: `#include <stdlib.h>
void f26(void* p) {}`,
void f26(void* p) {}`,
imports: []string{"unsafe"},
support: `type S26 struct { p *int; a [8*8]byte; u uintptr }`,
body: `i := 0; p := &S26{u:uintptr(unsafe.Pointer(&i))}; q := (*S26)(C.malloc(C.size_t(unsafe.Sizeof(*p)))); *q = *p; C.f26(unsafe.Pointer(q))`,
@ -305,7 +305,7 @@ var ptrTests = []ptrTest{
// Like ptrdata1, but with a type that uses a GC program.
name: "ptrdata2",
c: `#include <stdlib.h>
void f27(void* p) {}`,
void f27(void* p) {}`,
imports: []string{"unsafe"},
support: `type S27 struct { p *int; a [32769*8]byte; q *int; u uintptr }`,
body: `i := 0; p := S27{u:uintptr(unsafe.Pointer(&i))}; q := (*S27)(C.malloc(C.size_t(unsafe.Sizeof(p)))); *q = p; C.f27(unsafe.Pointer(q))`,
@ -423,6 +423,15 @@ var ptrTests = []ptrTest{
body: `t := reflect.StructOf([]reflect.StructField{{Name: "MyInt38", Type: reflect.TypeOf(MyInt38(0)), Anonymous: true}}); v := reflect.New(t).Elem(); v.Interface().(Getter38).Get()`,
fail: false,
},
{
// Test that a converted address of a struct field results
// in a check for just that field and not the whole struct.
name: "structfieldcast",
c: `struct S40i { int i; int* p; }; void f40(struct S40i* p) {}`,
support: `type S40 struct { p *int; a C.struct_S40i }`,
body: `s := &S40{p: new(int)}; C.f40((*C.struct_S40i)(&s.a))`,
fail: false,
},
}
func TestPointerChecks(t *testing.T) {
@ -466,6 +475,9 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
if err := os.MkdirAll(src, 0777); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
t.Fatal(err)
}
// Prepare two cgo inputs: one for standard cgo and one for //export cgo.
// (The latter cannot have C definitions, only declarations.)

17
misc/cgo/errors/testdata/issue33061.go vendored Normal file
View file

@ -0,0 +1,17 @@
// Copyright 2019 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.
// cgo shouldn't crash if there is an extra argument with a C reference.
package main
// void F(void* p) {};
import "C"
import "unsafe"
func F() {
var i int
C.F(unsafe.Pointer(&i), C.int(0)) // ERROR HERE
}

View file

@ -57,6 +57,7 @@ func Test26066(t *testing.T) { test26066(t) }
func Test27660(t *testing.T) { test27660(t) }
func Test28896(t *testing.T) { test28896(t) }
func Test30065(t *testing.T) { test30065(t) }
func Test32579(t *testing.T) { test32579(t) }
func TestAlign(t *testing.T) { testAlign(t) }
func TestAtol(t *testing.T) { testAtol(t) }
func TestBlocking(t *testing.T) { testBlocking(t) }

View file

@ -852,6 +852,8 @@ static void issue29781F(char **p, int n) {}
// issue 31093
static uint16_t issue31093F(uint16_t v) { return v; }
// issue 32579
typedef struct S32579 { unsigned char data[1]; } S32579;
*/
import "C"
@ -2083,3 +2085,13 @@ func test30065(t *testing.T) {
func Issue31093() {
C.issue31093F(C.ushort(0))
}
// issue 32579
func test32579(t *testing.T) {
var s [1]C.struct_S32579
C.memset(unsafe.Pointer(&s[0].data[0]), 1, 1)
if s[0].data[0] != 1 {
t.Errorf("&s[0].data[0] failed: got %d, want %d", s[0].data[0], 1)
}
}

View file

@ -941,3 +941,10 @@ func TestTestInstalledShared(t *testing.T) {
func TestGeneratedMethod(t *testing.T) {
goCmd(t, "install", "-buildmode=shared", "-linkshared", "./issue25065")
}
// Test use of shared library struct with generated hash function.
// Issue 30768.
func TestGeneratedHash(t *testing.T) {
goCmd(nil, "install", "-buildmode=shared", "-linkshared", "./issue30768/issue30768lib")
goCmd(nil, "test", "-linkshared", "./issue30768")
}

View file

@ -0,0 +1,11 @@
// Copyright 2019 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 issue30768lib
// S is a struct that requires a generated hash function.
type S struct {
A string
B int
}

View file

@ -0,0 +1,22 @@
// Copyright 2019 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 issue30768_test
import (
"testing"
"testshared/issue30768/issue30768lib"
)
type s struct {
s issue30768lib.S
}
func Test30768(t *testing.T) {
// Calling t.Log will convert S to an empty interface,
// which will force a reference to the generated hash function,
// defined in the shared library.
t.Log(s{})
}

View file

@ -0,0 +1,101 @@
// Copyright 2019 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.
// +build explicit
// Package experiment_toolid_test verifies that GOEXPERIMENT settings built
// into the toolchain influence tool ids in the Go command.
// This test requires bootstrapping the toolchain twice, so it's very expensive.
// It must be run explicitly with -tags=explicit.
// Verifies golang.org/issue/33091.
package reboot_test
import (
"bytes"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"testing"
)
func TestExperimentToolID(t *testing.T) {
// Set up GOROOT
goroot, err := ioutil.TempDir("", "experiment-goroot")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(goroot)
gorootSrc := filepath.Join(goroot, "src")
if err := overlayDir(gorootSrc, filepath.Join(runtime.GOROOT(), "src")); err != nil {
t.Fatal(err)
}
if err := ioutil.WriteFile(filepath.Join(goroot, "VERSION"), []byte("go1.999"), 0666); err != nil {
t.Fatal(err)
}
env := append(os.Environ(), "GOROOT=", "GOROOT_BOOTSTRAP="+runtime.GOROOT())
// Use a clean cache.
gocache, err := ioutil.TempDir("", "experiment-gocache")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(gocache)
env = append(env, "GOCACHE="+gocache)
// Build the toolchain without GOEXPERIMENT.
var makeScript string
switch runtime.GOOS {
case "windows":
makeScript = "make.bat"
case "plan9":
makeScript = "make.rc"
default:
makeScript = "make.bash"
}
makeScriptPath := filepath.Join(runtime.GOROOT(), "src", makeScript)
runCmd(t, gorootSrc, env, makeScriptPath)
// Verify compiler version string.
goCmdPath := filepath.Join(goroot, "bin", "go")
if runtime.GOOS == "windows" {
goCmdPath += ".exe"
}
gotVersion := bytes.TrimSpace(runCmd(t, gorootSrc, env, goCmdPath, "tool", "compile", "-V=full"))
wantVersion := []byte(`compile version go1.999`)
if !bytes.Equal(gotVersion, wantVersion) {
t.Errorf("compile version without experiment: got %q, want %q", gotVersion, wantVersion)
}
// Build a package in a mode not handled by the make script.
runCmd(t, gorootSrc, env, goCmdPath, "build", "-race", "archive/tar")
// Rebuild the toolchain with GOEXPERIMENT.
env = append(env, "GOEXPERIMENT=fieldtrack")
runCmd(t, gorootSrc, env, makeScriptPath)
// Verify compiler version string.
gotVersion = bytes.TrimSpace(runCmd(t, gorootSrc, env, goCmdPath, "tool", "compile", "-V=full"))
wantVersion = []byte(`compile version go1.999 X:fieldtrack,framepointer`)
if !bytes.Equal(gotVersion, wantVersion) {
t.Errorf("compile version with experiment: got %q, want %q", gotVersion, wantVersion)
}
// Build the same package. We should not get a cache conflict.
runCmd(t, gorootSrc, env, goCmdPath, "build", "-race", "archive/tar")
}
func runCmd(t *testing.T, dir string, env []string, path string, args ...string) []byte {
cmd := exec.Command(path, args...)
cmd.Dir = dir
cmd.Env = env
out, err := cmd.Output()
if err != nil {
t.Fatal(err)
}
return out
}

View file

@ -41,13 +41,13 @@ The vendor directory may be updated with 'go mod vendor'.
A typical sequence might be:
cd src
go get -m golang.org/x/net@latest
go get -d golang.org/x/net@latest
go mod tidy
go mod vendor
Use caution when passing '-u' to 'go get'. The '-u' flag updates
modules providing all transitively imported packages, not just
the target module.
modules providing all transitively imported packages, not only
the module providing the target package.
Note that 'go mod vendor' only copies packages that are transitively
imported by packages in the current module. If a new package is needed,

View file

@ -8,7 +8,6 @@ import (
"bufio"
"encoding/binary"
"errors"
"fmt"
"hash"
"hash/crc32"
"io"
@ -84,9 +83,6 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
if err != nil {
return err
}
if end.directoryRecords > uint64(size)/fileHeaderLen {
return fmt.Errorf("archive/zip: TOC declares impossible %d files in %d byte zip", end.directoryRecords, size)
}
z.r = r
z.File = make([]*File, 0, end.directoryRecords)
z.Comment = end.comment

View file

@ -981,15 +981,17 @@ func TestIssue10957(t *testing.T) {
}
}
// Verify the number of files is sane.
// Verify that this particular malformed zip file is rejected.
func TestIssue10956(t *testing.T) {
data := []byte("PK\x06\x06PK\x06\a0000\x00\x00\x00\x00\x00\x00\x00\x00" +
"0000PK\x05\x06000000000000" +
"0000\v\x00000\x00\x00\x00\x00\x00\x00\x000")
_, err := NewReader(bytes.NewReader(data), int64(len(data)))
const want = "TOC declares impossible 3472328296227680304 files in 57 byte"
if err == nil && !strings.Contains(err.Error(), want) {
t.Errorf("error = %v; want %q", err, want)
r, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err == nil {
t.Errorf("got nil error, want ErrFormat")
}
if r != nil {
t.Errorf("got non-nil Reader, want nil")
}
}

View file

@ -197,6 +197,9 @@ func (b *Reader) Discard(n int) (discarded int, err error) {
func (b *Reader) Read(p []byte) (n int, err error) {
n = len(p)
if n == 0 {
if b.Buffered() > 0 {
return 0, nil
}
return 0, b.readErr()
}
if b.r == b.w {

View file

@ -1481,6 +1481,60 @@ func newScriptedReader(steps ...func(p []byte) (n int, err error)) io.Reader {
return &sr
}
// eofReader returns the number of bytes read and io.EOF for the read that consumes the last of the content.
type eofReader struct {
buf []byte
}
func (r *eofReader) Read(p []byte) (int, error) {
read := copy(p, r.buf)
r.buf = r.buf[read:]
switch read {
case 0, len(r.buf):
// As allowed in the documentation, this will return io.EOF
// in the same call that consumes the last of the data.
// https://godoc.org/io#Reader
return read, io.EOF
}
return read, nil
}
func TestPartialReadEOF(t *testing.T) {
src := make([]byte, 10)
eofR := &eofReader{buf: src}
r := NewReader(eofR)
// Start by reading 5 of the 10 available bytes.
dest := make([]byte, 5)
read, err := r.Read(dest)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if n := len(dest); read != n {
t.Fatalf("read %d bytes; wanted %d bytes", read, n)
}
// The Reader should have buffered all the content from the io.Reader.
if n := len(eofR.buf); n != 0 {
t.Fatalf("got %d bytes left in bufio.Reader source; want 0 bytes", n)
}
// To prove the point, check that there are still 5 bytes available to read.
if n := r.Buffered(); n != 5 {
t.Fatalf("got %d bytes buffered in bufio.Reader; want 5 bytes", n)
}
// This is the second read of 0 bytes.
read, err = r.Read([]byte{})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if read != 0 {
t.Fatalf("read %d bytes; want 0 bytes", read)
}
}
func BenchmarkReaderCopyOptimal(b *testing.B) {
// Optimal case is where the underlying reader implements io.WriterTo
srcBuf := bytes.NewBuffer(make([]byte, 8192))

View file

@ -31,6 +31,19 @@ func ExampleScanner_lines() {
}
}
// Return the most recent call to Scan as a []byte.
func ExampleScanner_Bytes() {
scanner := bufio.NewScanner(strings.NewReader("gopher"))
for scanner.Scan() {
fmt.Println(len(scanner.Bytes()) == 6)
}
if err := scanner.Err(); err != nil {
fmt.Fprintln(os.Stderr, "shouldn't see an error scanning a string")
}
// Output:
// true
}
// Use a Scanner to implement a simple word-count utility by scanning the
// input as a sequence of space-delimited tokens.
func ExampleScanner_words() {

View file

@ -793,10 +793,10 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
params := name.FuncType.Params
args := call.Call.Args
// Avoid a crash if the number of arguments is
// less than the number of parameters.
// Avoid a crash if the number of arguments doesn't match
// the number of parameters.
// This will be caught when the generated file is compiled.
if len(args) < len(params) {
if len(args) != len(params) {
return "", false
}
@ -1239,6 +1239,8 @@ func (p *Package) isType(t ast.Expr) bool {
if strings.HasPrefix(t.Name, "_Ctype_") {
return true
}
case *ast.ParenExpr:
return p.isType(t.X)
case *ast.StarExpr:
return p.isType(t.X)
case *ast.ArrayType, *ast.StructType, *ast.FuncType, *ast.InterfaceType,
@ -1256,6 +1258,8 @@ func (p *Package) isVariable(x ast.Expr) bool {
return true
case *ast.SelectorExpr:
return p.isVariable(x.X)
case *ast.IndexExpr:
return true
}
return false
}

View file

@ -268,6 +268,35 @@ func (p *Package) writeDefs() {
}
}
// elfImportedSymbols is like elf.File.ImportedSymbols, but it
// includes weak symbols.
//
// A bug in some versions of LLD (at least LLD 8) cause it to emit
// several pthreads symbols as weak, but we need to import those. See
// issue #31912 or https://bugs.llvm.org/show_bug.cgi?id=42442.
//
// When doing external linking, we hand everything off to the external
// linker, which will create its own dynamic symbol tables. For
// internal linking, this may turn weak imports into strong imports,
// which could cause dynamic linking to fail if a symbol really isn't
// defined. However, the standard library depends on everything it
// imports, and this is the primary use of dynamic symbol tables with
// internal linking.
func elfImportedSymbols(f *elf.File) []elf.ImportedSymbol {
syms, _ := f.DynamicSymbols()
var imports []elf.ImportedSymbol
for _, s := range syms {
if (elf.ST_BIND(s.Info) == elf.STB_GLOBAL || elf.ST_BIND(s.Info) == elf.STB_WEAK) && s.Section == elf.SHN_UNDEF {
imports = append(imports, elf.ImportedSymbol{
Name: s.Name,
Library: s.Library,
Version: s.Version,
})
}
}
return imports
}
func dynimport(obj string) {
stdout := os.Stdout
if *dynout != "" {
@ -290,7 +319,7 @@ func dynimport(obj string) {
}
}
}
sym, _ := f.ImportedSymbols()
sym := elfImportedSymbols(f)
for _, s := range sym {
targ := s.Name
if s.Version != "" {

View file

@ -36,9 +36,9 @@ func zerorange(pp *gc.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog {
off += int64(gc.Widthptr)
cnt -= int64(gc.Widthptr)
}
p = pp.Appendpp(p, arm64.AMOVD, obj.TYPE_REG, arm64.REGSP, 0, obj.TYPE_REG, arm64.REGRT1, 0)
p = pp.Appendpp(p, arm64.AADD, obj.TYPE_CONST, 0, 8+off, obj.TYPE_REG, arm64.REGRT1, 0)
p.Reg = arm64.REGRT1
p = pp.Appendpp(p, arm64.AMOVD, obj.TYPE_REG, arm64.REGSP, 0, obj.TYPE_REG, arm64.REG_R20, 0)
p = pp.Appendpp(p, arm64.AADD, obj.TYPE_CONST, 0, 8+off, obj.TYPE_REG, arm64.REG_R20, 0)
p.Reg = arm64.REG_R20
p = pp.Appendpp(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_MEM, 0, 0)
p.To.Name = obj.NAME_EXTERN
p.To.Sym = gc.Duffzero

View file

@ -820,7 +820,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
p.To.Type = obj.TYPE_REG
p.To.Reg = v.Reg()
case ssa.OpARM64DUFFZERO:
// runtime.duffzero expects start address in R16
// runtime.duffzero expects start address in R20
p := s.Prog(obj.ADUFFZERO)
p.To.Type = obj.TYPE_MEM
p.To.Name = obj.NAME_EXTERN

View file

@ -27,11 +27,32 @@ func Rnd(o int64, r int64) int64 {
// expandiface computes the method set for interface type t by
// expanding embedded interfaces.
func expandiface(t *types.Type) {
var fields []*types.Field
seen := make(map[*types.Sym]*types.Field)
var methods []*types.Field
addMethod := func(m *types.Field, explicit bool) {
switch prev := seen[m.Sym]; {
case prev == nil:
seen[m.Sym] = m
case !explicit && types.Identical(m.Type, prev.Type):
return
default:
yyerrorl(m.Pos, "duplicate method %s", m.Sym.Name)
}
methods = append(methods, m)
}
for _, m := range t.Methods().Slice() {
if m.Sym == nil {
continue
}
checkwidth(m.Type)
addMethod(m, true)
}
for _, m := range t.Methods().Slice() {
if m.Sym != nil {
fields = append(fields, m)
checkwidth(m.Type)
continue
}
@ -43,7 +64,7 @@ func expandiface(t *types.Type) {
// include the broken embedded type when
// printing t.
// TODO(mdempsky): Revisit this.
fields = append(fields, m)
methods = append(methods, m)
continue
}
@ -56,26 +77,22 @@ func expandiface(t *types.Type) {
f.Sym = t1.Sym
f.Type = t1.Type
f.SetBroke(t1.Broke())
fields = append(fields, f)
addMethod(f, false)
}
}
sort.Sort(methcmp(fields))
sort.Sort(methcmp(methods))
if int64(len(methods)) >= thearch.MAXWIDTH/int64(Widthptr) {
yyerror("interface too large")
}
for i, m := range methods {
m.Offset = int64(i) * int64(Widthptr)
}
// Access fields directly to avoid recursively calling dowidth
// within Type.Fields().
t.Extra.(*types.Interface).Fields.Set(fields)
}
func offmod(t *types.Type) {
o := int32(0)
for _, f := range t.Fields().Slice() {
f.Offset = int64(o)
o += int32(Widthptr)
if int64(o) >= thearch.MAXWIDTH {
yyerror("interface too large")
o = int32(Widthptr)
}
}
t.Extra.(*types.Interface).Fields.Set(methods)
}
func widstruct(errtype *types.Type, t *types.Type, o int64, flag int) int64 {
@ -381,14 +398,6 @@ func dowidth(t *types.Type) {
t.Align = uint8(w)
}
if t.Etype == TINTER {
// We defer calling these functions until after
// setting t.Width and t.Align so the recursive calls
// to dowidth within t.Fields() will succeed.
checkdupfields("method", t)
offmod(t)
}
lineno = lno
if defercalc == 1 {

View file

@ -6,6 +6,8 @@ package gc
import (
"cmd/compile/internal/types"
"cmd/internal/src"
"fmt"
"math/big"
"strings"
)
@ -1397,7 +1399,7 @@ func hascallchan(n *Node) bool {
// A constSet represents a set of Go constant expressions.
type constSet struct {
m map[constSetKey]*Node
m map[constSetKey]src.XPos
}
type constSetKey struct {
@ -1405,20 +1407,22 @@ type constSetKey struct {
val interface{}
}
// add adds constant expressions to s. If a constant expression of
// equal value and identical type has already been added, then that
// type expression is returned. Otherwise, add returns nil.
// add adds constant expression n to s. If a constant expression of
// equal value and identical type has already been added, then add
// reports an error about the duplicate value.
//
// add also returns nil if n is not a Go constant expression.
// pos provides position information for where expression n occured
// (in case n does not have its own position information). what and
// where are used in the error message.
//
// n must not be an untyped constant.
func (s *constSet) add(n *Node) *Node {
func (s *constSet) add(pos src.XPos, n *Node, what, where string) {
if n.Op == OCONVIFACE && n.Implicit() {
n = n.Left
}
if !n.isGoConst() {
return nil
return
}
if n.Type.IsUntyped() {
Fatalf("%v is untyped", n)
@ -1448,12 +1452,32 @@ func (s *constSet) add(n *Node) *Node {
}
k := constSetKey{typ, n.Val().Interface()}
if hasUniquePos(n) {
pos = n.Pos
}
if s.m == nil {
s.m = make(map[constSetKey]*Node)
s.m = make(map[constSetKey]src.XPos)
}
old, dup := s.m[k]
if !dup {
s.m[k] = n
if prevPos, isDup := s.m[k]; isDup {
yyerrorl(pos, "duplicate %s %s in %s\n\tprevious %s at %v",
what, nodeAndVal(n), where,
what, linestr(prevPos))
} else {
s.m[k] = pos
}
return old
}
// nodeAndVal reports both an expression and its constant value, if
// the latter is non-obvious.
//
// TODO(mdempsky): This could probably be a fmt.go flag.
func nodeAndVal(n *Node) string {
show := n.String()
val := n.Val().Interface()
if s := fmt.Sprintf("%#v", val); show != s {
show += " (value " + s + ")"
}
return show
}

View file

@ -576,10 +576,10 @@ func structfield(n *Node) *types.Field {
// checkdupfields emits errors for duplicately named fields or methods in
// a list of struct or interface types.
func checkdupfields(what string, ts ...*types.Type) {
func checkdupfields(what string, fss ...[]*types.Field) {
seen := make(map[*types.Sym]bool)
for _, t := range ts {
for _, f := range t.Fields().Slice() {
for _, fs := range fss {
for _, f := range fs {
if f.Sym == nil || f.Sym.IsBlank() {
continue
}
@ -615,7 +615,7 @@ func tostruct0(t *types.Type, l []*Node) {
}
t.SetFields(fields)
checkdupfields("field", t)
checkdupfields("field", t.FieldSlice())
if !t.Broke() {
checkwidth(t)
@ -747,7 +747,7 @@ func functype0(t *types.Type, this *Node, in, out []*Node) {
t.FuncType().Params = tofunargs(in, types.FunargParams)
t.FuncType().Results = tofunargs(out, types.FunargResults)
checkdupfields("argument", t.Recvs(), t.Params(), t.Results())
checkdupfields("argument", t.Recvs().FieldSlice(), t.Params().FieldSlice(), t.Results().FieldSlice())
if t.Recvs().Broke() || t.Results().Broke() || t.Params().Broke() {
t.SetBroke(true)

View file

@ -614,9 +614,14 @@ func (e *Escape) unsafeValue(k EscHole, n *Node) {
}
case OPLUS, ONEG, OBITNOT:
e.unsafeValue(k, n.Left)
case OADD, OSUB, OOR, OXOR, OMUL, ODIV, OMOD, OLSH, ORSH, OAND, OANDNOT:
case OADD, OSUB, OOR, OXOR, OMUL, ODIV, OMOD, OAND, OANDNOT:
e.unsafeValue(k, n.Left)
e.unsafeValue(k, n.Right)
case OLSH, ORSH:
e.unsafeValue(k, n.Left)
// RHS need not be uintptr-typed (#32959) and can't meaningfully
// flow pointers anyway.
e.discard(n.Right)
default:
e.exprSkipInit(e.discardHole(), n)
}

View file

@ -31,10 +31,6 @@ func TestIntendedInlining(t *testing.T) {
// might not actually be inlined anywhere.
want := map[string][]string{
"runtime": {
// TODO(mvdan): enable these once mid-stack
// inlining is available
// "adjustctxt",
"add",
"acquirem",
"add1",

View file

@ -330,7 +330,6 @@ func deferstruct(stksize int64) *types.Type {
return f
}
argtype := types.NewArray(types.Types[TUINT8], stksize)
argtype.SetNoalg(true)
argtype.Width = stksize
argtype.Align = 1
// These fields must match the ones in runtime/runtime2.go:_defer and
@ -1687,7 +1686,17 @@ func (a typesByString) Less(i, j int) bool {
// they refer to byte or uint8, such as **byte vs **uint8,
// the types' ShortStrings can be identical.
// To preserve deterministic sort ordering, sort these by String().
return a[i].regular < a[j].regular
if a[i].regular != a[j].regular {
return a[i].regular < a[j].regular
}
// Identical anonymous interfaces defined in different locations
// will be equal for the above checks, but different in DWARF output.
// Sort by source position to ensure deterministic order.
// See issues 27013 and 30202.
if a[i].t.Etype == types.TINTER && a[i].t.Methods().Len() > 0 {
return a[i].t.Methods().Index(0).Pos.Before(a[j].t.Methods().Index(0).Pos)
}
return false
}
func (a typesByString) Swap(i, j int) { a[i], a[j] = a[j], a[i] }

View file

@ -18,6 +18,7 @@ func TestReproducibleBuilds(t *testing.T) {
tests := []string{
"issue20272.go",
"issue27013.go",
"issue30202.go",
}
testenv.MustHaveGoBuild(t)
@ -38,7 +39,9 @@ func TestReproducibleBuilds(t *testing.T) {
defer os.Remove(tmp.Name())
defer tmp.Close()
for i := 0; i < iters; i++ {
out, err := exec.Command(testenv.GoToolPath(t), "tool", "compile", "-o", tmp.Name(), filepath.Join("testdata", "reproducible", test)).CombinedOutput()
// Note: use -c 2 to expose any nondeterminism which is the result
// of the runtime scheduler.
out, err := exec.Command(testenv.GoToolPath(t), "tool", "compile", "-c", "2", "-o", tmp.Name(), filepath.Join("testdata", "reproducible", test)).CombinedOutput()
if err != nil {
t.Fatalf("failed to compile: %v\n%s", err, out)
}

View file

@ -908,7 +908,7 @@ func (s *state) stmt(n *Node) {
case ODCL:
if n.Left.Class() == PAUTOHEAP {
Fatalf("DCL %v", n)
s.Fatalf("DCL %v", n)
}
case OLABEL:
@ -966,7 +966,7 @@ func (s *state) stmt(n *Node) {
// rewritten during walk. Any that remain are just T{}
// or equivalents. Use the zero value.
if !isZero(rhs) {
Fatalf("literal with nonzero value in SSA: %v", rhs)
s.Fatalf("literal with nonzero value in SSA: %v", rhs)
}
rhs = nil
case OAPPEND:
@ -2295,7 +2295,7 @@ func (s *state) expr(n *Node) *ssa.Value {
// rewritten during walk. Any that remain are just T{}
// or equivalents. Use the zero value.
if !isZero(n.Left) {
Fatalf("literal with nonzero value in SSA: %v", n.Left)
s.Fatalf("literal with nonzero value in SSA: %v", n.Left)
}
return s.zeroVal(n.Type)
}
@ -2457,7 +2457,7 @@ func (s *state) expr(n *Node) *ssa.Value {
// rewritten during walk. Any that remain are just T{}
// or equivalents. Use the zero value.
if !isZero(n) {
Fatalf("literal with nonzero value in SSA: %v", n)
s.Fatalf("literal with nonzero value in SSA: %v", n)
}
return s.zeroVal(n.Type)
@ -3768,7 +3768,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
}
case OCALLMETH:
if fn.Op != ODOTMETH {
Fatalf("OCALLMETH: n.Left not an ODOTMETH: %v", fn)
s.Fatalf("OCALLMETH: n.Left not an ODOTMETH: %v", fn)
}
if k == callNormal {
sym = fn.Sym
@ -3790,7 +3790,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
// want to set it here.
case OCALLINTER:
if fn.Op != ODOTINTER {
Fatalf("OCALLINTER: n.Left not an ODOTINTER: %v", fn.Op)
s.Fatalf("OCALLINTER: n.Left not an ODOTINTER: %v", fn.Op)
}
i := s.expr(fn.Left)
itab := s.newValue1(ssa.OpITab, types.Types[TUINTPTR], i)
@ -3923,7 +3923,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
case sym != nil:
call = s.newValue1A(ssa.OpStaticCall, types.TypeMem, sym.Linksym(), s.mem())
default:
Fatalf("bad call type %v %v", n.Op, n)
s.Fatalf("bad call type %v %v", n.Op, n)
}
call.AuxInt = stksize // Call operations carry the argsize of the callee along with them
}
@ -4079,7 +4079,7 @@ func (s *state) canSSA(n *Node) bool {
return false
}
if n.Class() == PAUTOHEAP {
Fatalf("canSSA of PAUTOHEAP %v", n)
s.Fatalf("canSSA of PAUTOHEAP %v", n)
}
switch n.Class() {
case PEXTERN:
@ -4299,7 +4299,7 @@ func (s *state) rtcall(fn *obj.LSym, returns bool, results []*types.Type, args .
b.SetControl(call)
call.AuxInt = off - Ctxt.FixedFrameSize()
if len(results) > 0 {
Fatalf("panic call can't have results")
s.Fatalf("panic call can't have results")
}
return nil
}
@ -5258,7 +5258,7 @@ func emitStackObjects(e *ssafn, pp *Progs) {
// Locals have a negative Xoffset, in which case the offset is relative to varp.
off = duintptr(x, off, uint64(v.Xoffset))
if !typesym(v.Type).Siggen() {
Fatalf("stack object's type symbol not generated for type %s", v.Type)
e.Fatalf(v.Pos, "stack object's type symbol not generated for type %s", v.Type)
}
off = dsymptr(x, off, dtypesym(v.Type), 0)
}
@ -5597,10 +5597,10 @@ func defframe(s *SSAGenState, e *ssafn) {
continue
}
if n.Class() != PAUTO {
Fatalf("needzero class %d", n.Class())
e.Fatalf(n.Pos, "needzero class %d", n.Class())
}
if n.Type.Size()%int64(Widthptr) != 0 || n.Xoffset%int64(Widthptr) != 0 || n.Type.Size() == 0 {
Fatalf("var %L has size %d offset %d", n, n.Type.Size(), n.Xoffset)
e.Fatalf(n.Pos, "var %L has size %d offset %d", n, n.Type.Size(), n.Xoffset)
}
if lo != hi && n.Xoffset+n.Type.Size() >= lo-int64(2*Widthreg) {
@ -6096,7 +6096,7 @@ func (e *ssafn) SplitArray(name ssa.LocalSlot) ssa.LocalSlot {
n := name.N.(*Node)
at := name.Type
if at.NumElem() != 1 {
Fatalf("bad array size")
e.Fatalf(n.Pos, "bad array size")
}
et := at.Elem()
if n.Class() == PAUTO && !n.Addrtaken() {
@ -6186,7 +6186,7 @@ func (e *ssafn) Syslook(name string) *obj.LSym {
case "typedmemclr":
return typedmemclr
}
Fatalf("unknown Syslook func %v", name)
e.Fatalf(src.NoXPos, "unknown Syslook func %v", name)
return nil
}

View file

@ -194,30 +194,37 @@ func Fatalf(fmt_ string, args ...interface{}) {
errorexit()
}
func setlineno(n *Node) src.XPos {
lno := lineno
if n != nil {
switch n.Op {
case ONAME, OPACK:
break
case OLITERAL, OTYPE:
if n.Sym != nil {
break
}
fallthrough
default:
lineno = n.Pos
if !lineno.IsKnown() {
if Debug['K'] != 0 {
Warn("setlineno: unknown position (line 0)")
}
lineno = lno
}
// hasUniquePos reports whether n has a unique position that can be
// used for reporting error messages.
//
// It's primarily used to distinguish references to named objects,
// whose Pos will point back to their declaration position rather than
// their usage position.
func hasUniquePos(n *Node) bool {
switch n.Op {
case ONAME, OPACK:
return false
case OLITERAL, OTYPE:
if n.Sym != nil {
return false
}
}
if !n.Pos.IsKnown() {
if Debug['K'] != 0 {
Warn("setlineno: unknown position (line 0)")
}
return false
}
return true
}
func setlineno(n *Node) src.XPos {
lno := lineno
if n != nil && hasUniquePos(n) {
lineno = n.Pos
}
return lno
}

View file

@ -6,7 +6,6 @@ package gc
import (
"cmd/compile/internal/types"
"fmt"
"sort"
)
@ -641,23 +640,11 @@ func checkDupExprCases(exprname *Node, clauses []*Node) {
continue
}
if prev := cs.add(n); prev != nil {
yyerrorl(ncase.Pos, "duplicate case %s in switch\n\tprevious case at %v",
nodeAndVal(n), prev.Line())
}
cs.add(ncase.Pos, n, "case", "switch")
}
}
}
func nodeAndVal(n *Node) string {
show := n.String()
val := n.Val().Interface()
if s := fmt.Sprintf("%#v", val); show != s {
show += " (value " + s + ")"
}
return show
}
// walk generates an AST that implements sw,
// where sw is a type switch.
// The AST is generally of the form of a linear

View file

@ -0,0 +1,17 @@
// Copyright 2019 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 p
func A(x interface {
X() int
}) int {
return x.X()
}
func B(x interface {
X() int
}) int {
return x.X()
}

View file

@ -2911,9 +2911,7 @@ func typecheckcomplit(n *Node) (res *Node) {
r = typecheck(r, ctxExpr)
r = defaultlit(r, t.Key())
l.Left = assignconv(r, t.Key(), "map key")
if cs.add(l.Left) != nil {
yyerror("duplicate key %v in map literal", l.Left)
}
cs.add(lineno, l.Left, "key", "map literal")
r = l.Right
pushtype(r, t.Elem())

View file

@ -1608,13 +1608,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORL <v.Type> (SHLLconst <v.Type> [j0] (MOVWload [i0] {s} p mem)) y)
-> @mergePoint(b,x0,x1,y) (ORL <v.Type> (SHLLconst <v.Type> [j0] (MOVWload [i0] {s} p mem)) y)
(ORQ
s1:(SHLQconst [j1] x1:(MOVBload [i1] {s} p mem))
@ -1629,13 +1629,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVWload [i0] {s} p mem)) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVWload [i0] {s} p mem)) y)
(ORQ
s1:(SHLQconst [j1] x1:(MOVWload [i1] {s} p mem))
@ -1650,13 +1650,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVLload [i0] {s} p mem)) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVLload [i0] {s} p mem)) y)
// Little-endian indexed loads
@ -1733,13 +1733,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORL <v.Type> (SHLLconst <v.Type> [j0] (MOVWloadidx1 [i0] {s} p idx mem)) y)
-> @mergePoint(b,x0,x1,y) (ORL <v.Type> (SHLLconst <v.Type> [j0] (MOVWloadidx1 [i0] {s} p idx mem)) y)
(ORQ
s1:(SHLQconst [j1] x1:(MOVBloadidx1 [i1] {s} p idx mem))
@ -1754,13 +1754,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVWloadidx1 [i0] {s} p idx mem)) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVWloadidx1 [i0] {s} p idx mem)) y)
(ORQ
s1:(SHLQconst [j1] x1:(MOVWloadidx1 [i1] {s} p idx mem))
@ -1775,13 +1775,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVLloadidx1 [i0] {s} p idx mem)) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j0] (MOVLloadidx1 [i0] {s} p idx mem)) y)
// Big-endian loads
@ -1875,13 +1875,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORL <v.Type> (SHLLconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWload [i0] {s} p mem))) y)
-> @mergePoint(b,x0,x1,y) (ORL <v.Type> (SHLLconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWload [i0] {s} p mem))) y)
(ORQ
s0:(SHLQconst [j0] x0:(MOVBload [i0] {s} p mem))
@ -1896,13 +1896,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWload [i0] {s} p mem))) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWload [i0] {s} p mem))) y)
(ORQ
s0:(SHLQconst [j0] r0:(ROLWconst [8] x0:(MOVWload [i0] {s} p mem)))
@ -1919,7 +1919,7 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(r0)
@ -1927,7 +1927,7 @@
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (BSWAPL <typ.UInt32> (MOVLload [i0] {s} p mem))) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (BSWAPL <typ.UInt32> (MOVLload [i0] {s} p mem))) y)
// Big-endian indexed loads
@ -2021,13 +2021,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORL <v.Type> (SHLLconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWloadidx1 [i0] {s} p idx mem))) y)
-> @mergePoint(b,x0,x1,y) (ORL <v.Type> (SHLLconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWloadidx1 [i0] {s} p idx mem))) y)
(ORQ
s0:(SHLQconst [j0] x0:(MOVBloadidx1 [i0] {s} p idx mem))
@ -2042,13 +2042,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWloadidx1 [i0] {s} p idx mem))) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (ROLWconst <typ.UInt16> [8] (MOVWloadidx1 [i0] {s} p idx mem))) y)
(ORQ
s0:(SHLQconst [j0] r0:(ROLWconst [8] x0:(MOVWloadidx1 [i0] {s} p idx mem)))
@ -2065,7 +2065,7 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(r0)
@ -2073,7 +2073,7 @@
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (BSWAPL <typ.UInt32> (MOVLloadidx1 [i0] {s} p idx mem))) y)
-> @mergePoint(b,x0,x1,y) (ORQ <v.Type> (SHLQconst <v.Type> [j1] (BSWAPL <typ.UInt32> (MOVLloadidx1 [i0] {s} p idx mem))) y)
// Combine 2 byte stores + shift into rolw 8 + word store
(MOVBstore [i] {s} p w

View file

@ -495,14 +495,14 @@ func init() {
// arg1 = mem
// auxint = offset into duffzero code to start executing
// returns mem
// R16 aka arm64.REGRT1 changed as side effect
// R20 changed as side effect
{
name: "DUFFZERO",
aux: "Int64",
argLength: 2,
reg: regInfo{
inputs: []regMask{buildReg("R16")},
clobbers: buildReg("R16 R30"),
inputs: []regMask{buildReg("R20")},
clobbers: buildReg("R20 R30"),
},
faultOnNilArg0: true,
},
@ -529,19 +529,19 @@ func init() {
},
// duffcopy
// arg0 = address of dst memory (in R17 aka arm64.REGRT2, changed as side effect)
// arg1 = address of src memory (in R16 aka arm64.REGRT1, changed as side effect)
// arg0 = address of dst memory (in R21, changed as side effect)
// arg1 = address of src memory (in R20, changed as side effect)
// arg2 = mem
// auxint = offset into duffcopy code to start executing
// returns mem
// R16, R17 changed as side effect
// R20, R21 changed as side effect
{
name: "DUFFCOPY",
aux: "Int64",
argLength: 3,
reg: regInfo{
inputs: []regMask{buildReg("R17"), buildReg("R16")},
clobbers: buildReg("R16 R17 R26 R30"),
inputs: []regMask{buildReg("R21"), buildReg("R20")},
clobbers: buildReg("R20 R21 R26 R30"),
},
faultOnNilArg0: true,
faultOnNilArg1: true,

View file

@ -1535,13 +1535,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORW <v.Type> (SLWconst <v.Type> [j1] (MOVHZload [i0] {s} p mem)) y)
-> @mergePoint(b,x0,x1,y) (ORW <v.Type> (SLWconst <v.Type> [j1] (MOVHZload [i0] {s} p mem)) y)
(OR
s0:(SLDconst [j0] x0:(MOVBZload [i0] {s} p mem))
@ -1556,13 +1556,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVHZload [i0] {s} p mem)) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVHZload [i0] {s} p mem)) y)
(OR
s0:(SLDconst [j0] x0:(MOVHZload [i0] {s} p mem))
@ -1577,13 +1577,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVWZload [i0] {s} p mem)) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVWZload [i0] {s} p mem)) y)
// Big-endian indexed loads
@ -1665,13 +1665,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORW <v.Type> (SLWconst <v.Type> [j1] (MOVHZloadidx [i0] {s} p idx mem)) y)
-> @mergePoint(b,x0,x1,y) (ORW <v.Type> (SLWconst <v.Type> [j1] (MOVHZloadidx [i0] {s} p idx mem)) y)
(OR
s0:(SLDconst [j0] x0:(MOVBZloadidx [i0] {s} p idx mem))
@ -1686,13 +1686,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVHZloadidx [i0] {s} p idx mem)) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVHZloadidx [i0] {s} p idx mem)) y)
(OR
s0:(SLDconst [j0] x0:(MOVHZloadidx [i0] {s} p idx mem))
@ -1707,13 +1707,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVWZloadidx [i0] {s} p idx mem)) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j1] (MOVWZloadidx [i0] {s} p idx mem)) y)
// Little-endian loads
@ -1805,13 +1805,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORW <v.Type> (SLWconst <v.Type> [j0] (MOVHZreg (MOVHBRload [i0] {s} p mem))) y)
-> @mergePoint(b,x0,x1,y) (ORW <v.Type> (SLWconst <v.Type> [j0] (MOVHZreg (MOVHBRload [i0] {s} p mem))) y)
(OR
s1:(SLDconst [j1] x1:(MOVBZload [i1] {s} p mem))
@ -1827,13 +1827,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVHZreg (MOVHBRload [i0] {s} p mem))) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVHZreg (MOVHBRload [i0] {s} p mem))) y)
(OR
s1:(SLDconst [j1] r1:(MOVHZreg x1:(MOVHBRload [i1] {s} p mem)))
@ -1850,7 +1850,7 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(r0)
@ -1858,7 +1858,7 @@
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVWZreg (MOVWBRload [i0] {s} p mem))) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVWZreg (MOVWBRload [i0] {s} p mem))) y)
// Little-endian indexed loads
@ -1950,13 +1950,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (ORW <v.Type> (SLWconst <v.Type> [j0] (MOVHZreg (MOVHBRloadidx [i0] {s} p idx mem))) y)
-> @mergePoint(b,x0,x1,y) (ORW <v.Type> (SLWconst <v.Type> [j0] (MOVHZreg (MOVHBRloadidx [i0] {s} p idx mem))) y)
(OR
s1:(SLDconst [j1] x1:(MOVBZloadidx [i1] {s} p idx mem))
@ -1972,13 +1972,13 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVHZreg (MOVHBRloadidx [i0] {s} p idx mem))) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVHZreg (MOVHBRloadidx [i0] {s} p idx mem))) y)
(OR
s1:(SLDconst [j1] r1:(MOVHZreg x1:(MOVHBRloadidx [i1] {s} p idx mem)))
@ -1995,7 +1995,7 @@
&& s0.Uses == 1
&& s1.Uses == 1
&& or.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& mergePoint(b,x0,x1,y) != nil
&& clobber(x0)
&& clobber(x1)
&& clobber(r0)
@ -2003,7 +2003,7 @@
&& clobber(s0)
&& clobber(s1)
&& clobber(or)
-> @mergePoint(b,x0,x1) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVWZreg (MOVWBRloadidx [i0] {s} p idx mem))) y)
-> @mergePoint(b,x0,x1,y) (OR <v.Type> (SLDconst <v.Type> [j0] (MOVWZreg (MOVWBRloadidx [i0] {s} p idx mem))) y)
// Combine stores into store multiples.
// 32-bit

View file

@ -1733,6 +1733,12 @@
(Eq(8|16|32|64) s:(Sub(8|16|32|64) x y) (Const(8|16|32|64) [0])) && s.Uses == 1 -> (Eq(8|16|32|64) x y)
(Neq(8|16|32|64) s:(Sub(8|16|32|64) x y) (Const(8|16|32|64) [0])) && s.Uses == 1 -> (Neq(8|16|32|64) x y)
// Optimize bitsets
(Eq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [y])) && isPowerOfTwo(y)
-> (Neq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [0]))
(Neq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [y])) && isPowerOfTwo(y)
-> (Eq(8|16|32|64) (And(8|16|32|64) <t> x (Const(8|16|32|64) <t> [y])) (Const(8|16|32|64) <t> [0]))
// Reassociate expressions involving
// constants such that constants come first,
// exposing obvious constant-folding opportunities.

View file

@ -15,10 +15,14 @@ import (
"go/format"
"io/ioutil"
"log"
"os"
"path"
"regexp"
"runtime"
"runtime/pprof"
"sort"
"strings"
"sync"
)
type arch struct {
@ -93,11 +97,36 @@ func (a arch) regMaskComment(r regMask) string {
var archs []arch
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to `file`")
var memprofile = flag.String("memprofile", "", "write memory profile to `file`")
func main() {
flag.Parse()
if *cpuprofile != "" {
f, err := os.Create(*cpuprofile)
if err != nil {
log.Fatal("could not create CPU profile: ", err)
}
defer f.Close()
if err := pprof.StartCPUProfile(f); err != nil {
log.Fatal("could not start CPU profile: ", err)
}
defer pprof.StopCPUProfile()
}
sort.Sort(ArchsByName(archs))
genOp()
genLower()
if *memprofile != "" {
f, err := os.Create(*memprofile)
if err != nil {
log.Fatal("could not create memory profile: ", err)
}
defer f.Close()
runtime.GC() // get up-to-date statistics
if err := pprof.WriteHeapProfile(f); err != nil {
log.Fatal("could not write memory profile: ", err)
}
}
}
func genOp() {
@ -395,11 +424,26 @@ func (a arch) Name() string {
return s
}
// genLower generates all arch-specific rewrite Go source files. The files are
// generated and written concurrently, since it's a CPU-intensive task that can
// easily make use of many cores on a machine.
//
// Note that there is no limit on the concurrency at the moment. On a four-core
// laptop at the time of writing, peak RSS usually reached ~230MiB, which seems
// doable by practially any machine nowadays. If that stops being the case, we
// can cap this func to a fixed number of architectures being generated at once.
func genLower() {
var wg sync.WaitGroup
for _, a := range archs {
genRules(a)
genSplitLoadRules(a)
a := a
wg.Add(1)
go func() {
genRules(a)
genSplitLoadRules(a)
wg.Done()
}()
}
wg.Wait()
}
// countRegs returns the number of set bits in the register mask.

File diff suppressed because it is too large Load diff

View file

@ -18668,9 +18668,9 @@ var opcodeTable = [...]opInfo{
faultOnNilArg0: true,
reg: regInfo{
inputs: []inputInfo{
{0, 65536}, // R16
{0, 1048576}, // R20
},
clobbers: 536936448, // R16 R30
clobbers: 537919488, // R20 R30
},
},
{
@ -18694,10 +18694,10 @@ var opcodeTable = [...]opInfo{
faultOnNilArg1: true,
reg: regInfo{
inputs: []inputInfo{
{0, 131072}, // R17
{1, 65536}, // R16
{0, 2097152}, // R21
{1, 1048576}, // R20
},
clobbers: 604176384, // R16 R17 R26 R30
clobbers: 607125504, // R20 R21 R26 R30
},
},
{

View file

@ -530,6 +530,25 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) {
}
}
// Look through value-preserving extensions.
// If the domain is appropriate for the pre-extension Type,
// repeat the update with the pre-extension Value.
if isCleanExt(v) {
switch {
case d == signed && v.Args[0].Type.IsSigned():
fallthrough
case d == unsigned && !v.Args[0].Type.IsSigned():
ft.update(parent, v.Args[0], w, d, r)
}
}
if isCleanExt(w) {
switch {
case d == signed && w.Args[0].Type.IsSigned():
fallthrough
case d == unsigned && !w.Args[0].Type.IsSigned():
ft.update(parent, v, w.Args[0], d, r)
}
}
}
var opMin = map[Op]int64{
@ -584,6 +603,11 @@ func (ft *factsTable) isNonNegative(v *Value) bool {
}
}
// Check if v is a value-preserving extension of a non-negative value.
if isCleanExt(v) && ft.isNonNegative(v.Args[0]) {
return true
}
// Check if the signed poset can prove that the value is >= 0
return ft.order[0].OrderedOrEqual(ft.zero, v)
}
@ -1299,3 +1323,20 @@ func isConstDelta(v *Value) (w *Value, delta int64) {
}
return nil, 0
}
// isCleanExt reports whether v is the result of a value-preserving
// sign or zero extension
func isCleanExt(v *Value) bool {
switch v.Op {
case OpSignExt8to16, OpSignExt8to32, OpSignExt8to64,
OpSignExt16to32, OpSignExt16to64, OpSignExt32to64:
// signed -> signed is the only value-preserving sign extension
return v.Args[0].Type.IsSigned() && v.Type.IsSigned()
case OpZeroExt8to16, OpZeroExt8to32, OpZeroExt8to64,
OpZeroExt16to32, OpZeroExt16to64, OpZeroExt32to64:
// unsigned -> signed/unsigned are value-preserving zero extensions
return !v.Args[0].Type.IsSigned()
}
return false
}

View file

@ -1455,7 +1455,7 @@ func (s *regAllocState) regalloc(f *Func) {
}
}
// Avoid registers we're saving for other values.
if mask&^desired.avoid != 0 {
if mask&^desired.avoid&^s.nospill != 0 {
mask &^= desired.avoid
}
r := s.allocReg(mask, v)

View file

@ -3,18 +3,9 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValue386(v *Value) bool {
switch v.Op {
case Op386ADCL:
@ -24539,11 +24530,7 @@ func rewriteValue386_OpZeromask_0(v *Value) bool {
}
}
func rewriteBlock386(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
case Block386EQ:
// match: (EQ (InvertFlags cmp) yes no)

View file

@ -3,18 +3,6 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValue386splitload(v *Value) bool {
switch v.Op {
case Op386CMPBconstload:
@ -168,11 +156,6 @@ func rewriteValue386splitload_Op386CMPWload_0(v *Value) bool {
}
}
func rewriteBlock386splitload(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
}
return false

File diff suppressed because it is too large Load diff

View file

@ -3,18 +3,6 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValueAMD64splitload(v *Value) bool {
switch v.Op {
case OpAMD64CMPBconstload:
@ -217,11 +205,6 @@ func rewriteValueAMD64splitload_OpAMD64CMPWload_0(v *Value) bool {
}
}
func rewriteBlockAMD64splitload(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
}
return false

View file

@ -3,18 +3,9 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValueARM(v *Value) bool {
switch v.Op {
case OpARMADC:
@ -21785,11 +21776,7 @@ func rewriteValueARM_OpZeromask_0(v *Value) bool {
}
}
func rewriteBlockARM(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
case BlockARMEQ:
// match: (EQ (FlagEQ) yes no)

View file

@ -3,18 +3,8 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValueARM64(v *Value) bool {
switch v.Op {
case OpARM64ADCSflags:
@ -38293,11 +38283,7 @@ func rewriteValueARM64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockARM64(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
case BlockARM64EQ:
// match: (EQ (CMPWconst [0] x:(ANDconst [c] y)) yes no)

View file

@ -3,18 +3,8 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValueMIPS(v *Value) bool {
switch v.Op {
case OpAdd16:
@ -9452,11 +9442,7 @@ func rewriteValueMIPS_OpZeromask_0(v *Value) bool {
}
}
func rewriteBlockMIPS(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
case BlockMIPSEQ:
// match: (EQ (FPFlagTrue cmp) yes no)

View file

@ -3,18 +3,8 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValueMIPS64(v *Value) bool {
switch v.Op {
case OpAdd16:
@ -10186,11 +10176,7 @@ func rewriteValueMIPS64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockMIPS64(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
case BlockMIPS64EQ:
// match: (EQ (FPFlagTrue cmp) yes no)

View file

@ -3,18 +3,10 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValuePPC64(v *Value) bool {
switch v.Op {
case OpAbs:
@ -30305,11 +30297,7 @@ func rewriteValuePPC64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockPPC64(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
case BlockPPC64EQ:
// match: (EQ (CMPconst [0] (ANDconst [c] x)) yes no)

File diff suppressed because it is too large Load diff

View file

@ -3,18 +3,9 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValueWasm(v *Value) bool {
switch v.Op {
case OpAbs:
@ -6555,11 +6546,6 @@ func rewriteValueWasm_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockWasm(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
}
return false

View file

@ -3,18 +3,8 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValuedec(v *Value) bool {
switch v.Op {
case OpComplexImag:
@ -492,11 +482,6 @@ func rewriteValuedec_OpStringPtr_0(v *Value) bool {
return false
}
func rewriteBlockdec(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
}
return false

View file

@ -3,18 +3,8 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValuedec64(v *Value) bool {
switch v.Op {
case OpAdd64:
@ -2726,11 +2716,6 @@ func rewriteValuedec64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockdec64(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
}
return false

View file

@ -3,18 +3,6 @@
package ssa
import "fmt"
import "math"
import "cmd/internal/obj"
import "cmd/internal/objabi"
import "cmd/compile/internal/types"
var _ = fmt.Println // in case not otherwise used
var _ = math.MinInt8 // in case not otherwise used
var _ = obj.ANOP // in case not otherwise used
var _ = objabi.GOROOT // in case not otherwise used
var _ = types.TypeMem // in case not otherwise used
func rewriteValuedecArgs(v *Value) bool {
switch v.Op {
case OpArg:
@ -270,11 +258,6 @@ func rewriteValuedecArgs_OpArg_10(v *Value) bool {
return false
}
func rewriteBlockdecArgs(b *Block) bool {
config := b.Func.Config
typ := &config.Types
_ = typ
v := b.Control
_ = v
switch b.Kind {
}
return false

File diff suppressed because it is too large Load diff

View file

@ -520,6 +520,10 @@ func IsReadOnlyGlobalAddr(v *Value) bool {
if !IsGlobalAddr(v) {
return false
}
if v.Op == OpConst64 || v.Op == OpConst32 {
// Nil pointers are read only. See issue 33438.
return true
}
// See TODO in OpAddr case in IsSanitizerSafeAddr below.
return strings.HasPrefix(v.Aux.(*obj.LSym).Name, `""..stmp_`)
}

View file

@ -869,7 +869,7 @@ func (p *parser) operand(keep_parens bool) Expr {
default:
x := p.bad()
p.syntaxError("expecting expression")
p.advance()
p.advance(_Rparen, _Rbrack, _Rbrace)
return x
}
@ -1840,6 +1840,9 @@ func (p *parser) header(keyword token) (init SimpleStmt, cond Expr, post SimpleS
} else {
// asking for a '{' rather than a ';' here leads to a better error message
p.want(_Lbrace)
if p.tok != _Lbrace {
p.advance(_Lbrace, _Rbrace) // for better synchronization (e.g., issue #22581)
}
}
if keyword == _For {
if p.tok != _Semi {

View file

@ -920,7 +920,10 @@ func TestDotSlashLookup(t *testing.T) {
t.Skip("scanning file system takes too long")
}
maybeSkip(t)
where := pwd()
where, err := os.Getwd()
if err != nil {
t.Fatal(err)
}
defer func() {
if err := os.Chdir(where); err != nil {
t.Fatal(err)
@ -931,7 +934,7 @@ func TestDotSlashLookup(t *testing.T) {
}
var b bytes.Buffer
var flagSet flag.FlagSet
err := do(&b, &flagSet, []string{"./template"})
err = do(&b, &flagSet, []string{"./template"})
if err != nil {
t.Errorf("unexpected error %q from ./template", err)
}

View file

@ -187,16 +187,20 @@ func failMessage(paths []string, symbol, method string) error {
// is rand.Float64, we must scan both crypto/rand and math/rand
// to find the symbol, and the first call will return crypto/rand, true.
func parseArgs(args []string) (pkg *build.Package, path, symbol string, more bool) {
wd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
if len(args) == 0 {
// Easy: current directory.
return importDir(pwd()), "", "", false
return importDir(wd), "", "", false
}
arg := args[0]
// We have an argument. If it is a directory name beginning with . or ..,
// use the absolute path name. This discriminates "./errors" from "errors"
// if the current directory contains a non-standard errors package.
if isDotSlash(arg) {
arg = filepath.Join(pwd(), arg)
arg = filepath.Join(wd, arg)
}
switch len(args) {
default:
@ -205,7 +209,7 @@ func parseArgs(args []string) (pkg *build.Package, path, symbol string, more boo
// Done below.
case 2:
// Package must be findable and importable.
pkg, err := build.Import(args[0], "", build.ImportComment)
pkg, err := build.Import(args[0], wd, build.ImportComment)
if err == nil {
return pkg, args[0], args[1], false
}
@ -225,7 +229,7 @@ func parseArgs(args []string) (pkg *build.Package, path, symbol string, more boo
// First, is it a complete package path as it is? If so, we are done.
// This avoids confusion over package paths that have other
// package paths as their prefix.
pkg, err := build.Import(arg, "", build.ImportComment)
pkg, err = build.Import(arg, wd, build.ImportComment)
if err == nil {
return pkg, arg, "", false
}
@ -260,7 +264,7 @@ func parseArgs(args []string) (pkg *build.Package, path, symbol string, more boo
symbol = arg[period+1:]
}
// Have we identified a package already?
pkg, err := build.Import(arg[0:period], "", build.ImportComment)
pkg, err := build.Import(arg[0:period], wd, build.ImportComment)
if err == nil {
return pkg, arg[0:period], symbol, false
}
@ -283,7 +287,7 @@ func parseArgs(args []string) (pkg *build.Package, path, symbol string, more boo
log.Fatalf("no such package %s", arg[0:period])
}
// Guess it's a symbol in the current directory.
return importDir(pwd()), "", arg, false
return importDir(wd), "", arg, false
}
// dotPaths lists all the dotted paths legal on Unix-like and
@ -385,12 +389,3 @@ var buildCtx = build.Default
func splitGopath() []string {
return filepath.SplitList(buildCtx.GOPATH)
}
// pwd returns the current directory.
func pwd() string {
wd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
return wd
}

View file

@ -5,7 +5,7 @@ go 1.12
require (
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f
github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44 // indirect
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
golang.org/x/tools v0.0.0-20190611154301-25a4f137592f

View file

@ -2,16 +2,19 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f h1:Jnx61latede7zDD3Di
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44 h1:pKqc8lAAA6rcwpvsephnRuZp4VHbfszZRClvqAE6Sq8=
github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 h1:Pn8fQdvx+z1avAi7fdM2kRYWQNxGlavNDSyzrQg2SsU=
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8=
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1 h1:A71BZbKSu+DtCNry/x5JKn20C+64DirDHmePEA8k0FY=
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190611154301-25a4f137592f h1:6awn5JC4pwVI5HiBqs7MDtRxnwV9PpO5iSA9v6P09pA=
golang.org/x/tools v0.0.0-20190611154301-25a4f137592f/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

View file

@ -78,6 +78,8 @@
// If the arguments to build are a list of .go files from a single directory,
// build treats them as a list of source files specifying a single package.
//
// When compiling packages, build ignores files that end in '_test.go'.
//
// When compiling a single main package, build writes
// the resulting executable to an output file named after
// the first source file ('go build ed.go rx.go' writes 'ed' or 'ed.exe')
@ -88,8 +90,6 @@
// build compiles the packages but discards the resulting object,
// serving only as a check that the packages can be built.
//
// When compiling packages, build ignores files that end in '_test.go'.
//
// The -o flag forces build to write the resulting executable or object
// to the named output file or directory, instead of the default behavior described
// in the last two paragraphs. If the named output is a directory that exists,
@ -566,17 +566,27 @@
// The first step is to resolve which dependencies to add.
//
// For each named package or package pattern, get must decide which version of
// the corresponding module to use. By default, get chooses the latest tagged
// the corresponding module to use. By default, get looks up the latest tagged
// release version, such as v0.4.5 or v1.2.3. If there are no tagged release
// versions, get chooses the latest tagged pre-release version, such as
// v0.0.1-pre1. If there are no tagged versions at all, get chooses the latest
// known commit.
// versions, get looks up the latest tagged pre-release version, such as
// v0.0.1-pre1. If there are no tagged versions at all, get looks up the latest
// known commit. If the module is not already required at a later version
// (for example, a pre-release newer than the latest release), get will use
// the version it looked up. Otherwise, get will use the currently
// required version.
//
// This default version selection can be overridden by adding an @version
// suffix to the package argument, as in 'go get golang.org/x/text@v0.3.0'.
// The version may be a prefix: @v1 denotes the latest available version starting
// with v1. See 'go help modules' under the heading 'Module queries' for the
// full query syntax.
//
// For modules stored in source control repositories, the version suffix can
// also be a commit hash, branch identifier, or other syntax known to the
// source control system, as in 'go get golang.org/x/text@master'.
// source control system, as in 'go get golang.org/x/text@master'. Note that
// branches with names that overlap with other module query syntax cannot be
// selected explicitly. For example, the suffix @v2 means the latest version
// starting with v2, not the branch named v2.
//
// If a module under consideration is already a dependency of the current
// development module, then get will update the required version.
@ -586,12 +596,14 @@
// depending on it as needed.
//
// The version suffix @latest explicitly requests the latest minor release of the
// given path. The suffix @patch requests the latest patch release: if the path
// is already in the build list, the selected version will have the same minor
// version. If the path is not already in the build list, @patch is equivalent
// to @latest. Neither @latest nor @patch will cause 'go get' to downgrade a module
// in the build list if it is required at a newer pre-release version that is
// newer than the latest released version.
// module named by the given path. The suffix @upgrade is like @latest but
// will not downgrade a module if it is already required at a revision or
// pre-release version newer than the latest released version. The suffix
// @patch requests the latest patch release: the latest released version
// with the same major and minor version numbers as the currently required
// version. Like @upgrade, @patch will not downgrade a module already required
// at a newer version. If the path is not already required, @upgrade and @patch
// are equivalent to @latest.
//
// Although get defaults to using the latest version of the module containing
// a named package, it does not use the latest version of that module's
@ -1006,6 +1018,7 @@
// Dir string // absolute path to cached source root directory
// Sum string // checksum for path, version (as in go.sum)
// GoModSum string // checksum for go.mod (as in go.sum)
// Latest bool // would @latest resolve to this version?
// }
//
// See 'go help modules' for more about module queries.
@ -1562,6 +1575,9 @@
// GOCACHE
// The directory where the go command will store cached
// information for reuse in future builds.
// GODEBUG
// Enable various debugging facilities. See 'go doc runtime'
// for details.
// GOENV
// The location of the Go environment configuration file.
// Cannot be set using 'go env -w'.
@ -1806,6 +1822,13 @@
// including go build, go get, go install, go list, go test, go mod graph,
// go mod tidy, and go mod why.
//
// The expected language version, set by the go directive, determines
// which language features are available when compiling the module.
// Language features available in that version will be available for use.
// Language features removed in earlier versions, or added in later versions,
// will not be available. Note that the language version does not affect
// build tags, which are determined by the Go release being used.
//
//
// GOPATH environment variable
//
@ -2489,12 +2512,25 @@
// The string "latest" matches the latest available tagged version,
// or else the underlying source repository's latest untagged revision.
//
// A revision identifier for the underlying source repository,
// such as a commit hash prefix, revision tag, or branch name,
// selects that specific code revision. If the revision is
// also tagged with a semantic version, the query evaluates to
// that semantic version. Otherwise the query evaluates to a
// pseudo-version for the commit.
// The string "upgrade" is like "latest", but if the module is
// currently required at a later version than the version "latest"
// would select (for example, a newer pre-release version), "upgrade"
// will select the later version instead.
//
// The string "patch" matches the latest available tagged version
// of a module with the same major and minor version numbers as the
// currently required version. If no version is currently required,
// "patch" is equivalent to "latest".
//
// A revision identifier for the underlying source repository, such as
// a commit hash prefix, revision tag, or branch name, selects that
// specific code revision. If the revision is also tagged with a
// semantic version, the query evaluates to that semantic version.
// Otherwise the query evaluates to a pseudo-version for the commit.
// Note that branches and tags with names that are matched by other
// query syntax cannot be selected this way. For example, the query
// "v2" means the latest version starting with "v2", not the branch
// named "v2".
//
// All queries prefer release versions to pre-release versions.
// For example, "<v1.2.3" will prefer to return "v1.2.2"
@ -2707,9 +2743,11 @@
// GOSUMDB="sum.golang.org+<publickey>"
// GOSUMDB="sum.golang.org+<publickey> https://sum.golang.org"
//
// The go command knows the public key of sum.golang.org; use of any other
// database requires giving the public key explicitly. The URL defaults to
// "https://" followed by the database name.
// The go command knows the public key of sum.golang.org, and also that the name
// sum.golang.google.cn (available inside mainland China) connects to the
// sum.golang.org checksum database; use of any other database requires giving
// the public key explicitly.
// The URL defaults to "https://" followed by the database name.
//
// GOSUMDB defaults to "sum.golang.org", the Go checksum database run by Google.
// See https://sum.golang.org/privacy for the service's privacy policy.
@ -2760,7 +2798,7 @@
// GOPROXY=proxy.example.com
// GONOPROXY=none
//
// This would tell the go comamnd and other tools that modules beginning with
// This would tell the go command and other tools that modules beginning with
// a corp.example.com subdomain are private but that the company proxy should
// be used for downloading both public and private modules, because
// GONOPROXY has been set to a pattern that won't match any modules,

View file

@ -3176,6 +3176,12 @@ func TestGoTestFooTestWorks(t *testing.T) {
tg.run("test", "testdata/standalone_test.go")
}
func TestGoTestTestMainSeesTestingFlags(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
tg.run("test", "testdata/standalone_testmain_flag_test.go")
}
// Issue 22388
func TestGoTestMainWithWrongSignature(t *testing.T) {
tg := testgo(t)
@ -5069,6 +5075,11 @@ func TestExecBuildX(t *testing.T) {
tg.tempDir("cache")
tg.setenv("GOCACHE", tg.path("cache"))
// Before building our test main.go, ensure that an up-to-date copy of
// runtime/cgo is present in the cache. If it isn't, the 'go build' step below
// will fail with "can't open import". See golang.org/issue/29004.
tg.run("build", "runtime/cgo")
tg.tempFile("main.go", `package main; import "C"; func main() { print("hello") }`)
src := tg.path("main.go")
obj := tg.path("main")

View file

@ -173,7 +173,7 @@ func (c *Cache) get(id ActionID) (Entry, error) {
i++
}
tm, err := strconv.ParseInt(string(etime[i:]), 10, 64)
if err != nil || size < 0 {
if err != nil || tm < 0 {
return missing()
}
@ -322,7 +322,7 @@ func (c *Cache) putIndexEntry(id ActionID, out OutputID, size int64, allowVerify
// in verify mode we are double-checking that the cache entries
// are entirely reproducible. As just noted, this may be unrealistic
// in some cases but the check is also useful for shaking out real bugs.
entry := []byte(fmt.Sprintf("v1 %x %x %20d %20d\n", id, out, size, time.Now().UnixNano()))
entry := fmt.Sprintf("v1 %x %x %20d %20d\n", id, out, size, time.Now().UnixNano())
if verify && allowVerify {
old, err := c.get(id)
if err == nil && (old.OutputID != out || old.Size != size) {
@ -332,7 +332,28 @@ func (c *Cache) putIndexEntry(id ActionID, out OutputID, size int64, allowVerify
}
}
file := c.fileName(id, "a")
if err := ioutil.WriteFile(file, entry, 0666); err != nil {
// Copy file to cache directory.
mode := os.O_WRONLY | os.O_CREATE
f, err := os.OpenFile(file, mode, 0666)
if err != nil {
return err
}
_, err = f.WriteString(entry)
if err == nil {
// Truncate the file only *after* writing it.
// (This should be a no-op, but truncate just in case of previous corruption.)
//
// This differs from ioutil.WriteFile, which truncates to 0 *before* writing
// via os.O_TRUNC. Truncating only after writing ensures that a second write
// of the same content to the same file is idempotent, and does not — even
// temporarily! — undo the effect of the first write.
err = f.Truncate(int64(len(entry)))
}
if closeErr := f.Close(); err == nil {
err = closeErr
}
if err != nil {
// TODO(bcmills): This Remove potentially races with another go command writing to file.
// Can we eliminate it?
os.Remove(file)

View file

@ -10,6 +10,7 @@ import (
"bytes"
"fmt"
"go/build"
"internal/cfg"
"io/ioutil"
"os"
"path/filepath"
@ -221,61 +222,9 @@ func Getenv(key string) string {
// CanGetenv reports whether key is a valid go/env configuration key.
func CanGetenv(key string) bool {
return strings.Contains(knownEnv, "\t"+key+"\n")
return strings.Contains(cfg.KnownEnv, "\t"+key+"\n")
}
var knownEnv = `
AR
CC
CGO_CFLAGS
CGO_CFLAGS_ALLOW
CGO_CFLAGS_DISALLOW
CGO_CPPFLAGS
CGO_CPPFLAGS_ALLOW
CGO_CPPFLAGS_DISALLOW
CGO_CXXFLAGS
CGO_CXXFLAGS_ALLOW
CGO_CXXFLAGS_DISALLOW
CGO_ENABLED
CGO_FFLAGS
CGO_FFLAGS_ALLOW
CGO_FFLAGS_DISALLOW
CGO_LDFLAGS
CGO_LDFLAGS_ALLOW
CGO_LDFLAGS_DISALLOW
CXX
FC
GCCGO
GO111MODULE
GO386
GOARCH
GOARM
GOBIN
GOCACHE
GOENV
GOEXE
GOFLAGS
GOGCCFLAGS
GOHOSTARCH
GOHOSTOS
GOMIPS
GOMIPS64
GONOPROXY
GONOSUMDB
GOOS
GOPATH
GOPPC64
GOPRIVATE
GOPROXY
GOROOT
GOSUMDB
GOTMPDIR
GOTOOLDIR
GOWASM
GO_EXTLINK_ENABLED
PKG_CONFIG
`
var (
GOROOT = BuildContext.GOROOT
GOBIN = Getenv("GOBIN")

View file

@ -63,7 +63,7 @@ Args:
// helpSuccess is the help command using as many args as possible that would succeed.
helpSuccess := "go help"
if i > 0 {
helpSuccess = " " + strings.Join(args[:i], " ")
helpSuccess += " " + strings.Join(args[:i], " ")
}
fmt.Fprintf(os.Stderr, "go help %s: unknown help topic. Run '%s'.\n", strings.Join(args, " "), helpSuccess)
base.SetExitStatus(2) // failed at 'go help cmd'

View file

@ -493,6 +493,9 @@ General-purpose environment variables:
GOCACHE
The directory where the go command will store cached
information for reuse in future builds.
GODEBUG
Enable various debugging facilities. See 'go doc runtime'
for details.
GOENV
The location of the Go environment configuration file.
Cannot be set using 'go env -w'.

View file

@ -138,6 +138,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
if name == "linux" {
have = have || tags["android"]
}
if name == "solaris" {
have = have || tags["illumos"]
}
return have == want
}
@ -152,7 +155,9 @@ func matchTag(name string, tags map[string]bool, want bool) bool {
// name_$(GOARCH)_test.*
// name_$(GOOS)_$(GOARCH)_test.*
//
// An exception: if GOOS=android, then files with GOOS=linux are also matched.
// Exceptions:
// if GOOS=android, then files with GOOS=linux are also matched.
// if GOOS=illumos, then files with GOOS=solaris are also matched.
//
// If tags["*"] is true, then MatchFile will consider all possible
// GOOS and GOARCH to be available and will consequently

View file

@ -0,0 +1,3 @@
package illumos
import _ "a"

View file

@ -0,0 +1,3 @@
package illumos
import _ "b"

View file

@ -0,0 +1,3 @@
package illumos
import _ "c"

View file

@ -0,0 +1,3 @@
package illumos
import _ "d"

View file

@ -0,0 +1,5 @@
// +build illumos
package illumos
import _ "e"

View file

@ -0,0 +1,5 @@
// +build solaris
package illumos
import _ "f"

View file

@ -0,0 +1,5 @@
// +build !illumos
package illumos
import _ "g"

View file

@ -0,0 +1 @@
illumos amd64

View file

@ -0,0 +1,6 @@
a
b
c
d
e
f

View file

@ -390,7 +390,7 @@ func runList(cmd *base.Command, args []string) {
if !*listE {
for _, m := range mods {
if m.Error != nil {
base.Errorf("go list -m %s: %v", m.Path, m.Error.Err)
base.Errorf("go list -m: %v", m.Error.Err)
}
}
base.ExitIfErrors()
@ -459,7 +459,7 @@ func runList(cmd *base.Command, args []string) {
}
if pmain != nil {
pkgs = append(pkgs, pmain)
data := pmain.Internal.TestmainGo
data := *pmain.Internal.TestmainGo
h := cache.NewHash("testmain")
h.Write([]byte("testmain\n"))
h.Write(data)

View file

@ -64,7 +64,7 @@ type PackagePublic struct {
Doc string `json:",omitempty"` // package documentation string
Target string `json:",omitempty"` // installed target for this package (may be executable)
Shlib string `json:",omitempty"` // the shared library that contains this package (only set when -linkshared)
Root string `json:",omitempty"` // Go root or Go path dir containing this package
Root string `json:",omitempty"` // Go root, Go path dir, or module root dir containing this package
ConflictDir string `json:",omitempty"` // Dir is hidden by this other directory
ForTest string `json:",omitempty"` // package is only for use in named test
Export string `json:",omitempty"` // file containing export data (set by go list -export)
@ -177,8 +177,7 @@ type PackageInternal struct {
OmitDebug bool // tell linker not to write debug information
GobinSubdir bool // install target would be subdir of GOBIN
BuildInfo string // add this info to package main
TestinginitGo []byte // content for _testinginit.go
TestmainGo []byte // content for _testmain.go
TestmainGo *[]byte // content for _testmain.go
Asmflags []string // -asmflags for this package
Gcflags []string // -gcflags for this package
@ -653,9 +652,14 @@ func loadPackageData(path, parentPath, parentDir, parentRoot string, parentIsStd
buildMode = build.ImportComment
}
data.p, data.err = cfg.BuildContext.ImportDir(r.dir, buildMode)
if data.p.Root == "" && cfg.ModulesEnabled {
if info := ModPackageModuleInfo(path); info != nil {
data.p.Root = info.Dir
}
}
} else if r.err != nil {
data.p = new(build.Package)
data.err = fmt.Errorf("unknown import path %q: %v", r.path, r.err)
data.err = r.err
} else if cfg.ModulesEnabled && path != "unsafe" {
data.p = new(build.Package)
data.err = fmt.Errorf("unknown import path %q: internal error: module loader did not resolve import", r.path)
@ -668,11 +672,17 @@ func loadPackageData(path, parentPath, parentDir, parentRoot string, parentIsStd
data.p, data.err = cfg.BuildContext.Import(r.path, parentDir, buildMode)
}
data.p.ImportPath = r.path
if cfg.GOBIN != "" {
data.p.BinDir = cfg.GOBIN
} else if cfg.ModulesEnabled && !data.p.Goroot {
data.p.BinDir = ModBinDir()
// Set data.p.BinDir in cases where go/build.Context.Import
// may give us a path we don't want.
if !data.p.Goroot {
if cfg.GOBIN != "" {
data.p.BinDir = cfg.GOBIN
} else if cfg.ModulesEnabled {
data.p.BinDir = ModBinDir()
}
}
if !cfg.ModulesEnabled && data.err == nil &&
data.p.ImportComment != "" && data.p.ImportComment != path &&
!strings.Contains(path, "/vendor/") && !strings.HasPrefix(path, "vendor/") {

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