cmd/go: do not panic on template I/O error
cmd/go: do not panic on template I/O error

Fixes #11839.

Change-Id: Ie092a3a512a2d35967364b41081a066ab3a6aab4
Reviewed-on: https://go-review.googlesource.com/12571
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

jacobsa/go,sinuos/go,theif519/go,jonathanmarvens/go,mgyenik/go,mwhudson/go,danycoro/go,ichu501/go,mikekap/go,honsiorovskyi/go,zcwfeng/go,dterei/go,ObjectiveJoe/go,famorted/go,AALEKH/go,Endika/go,vsdutka/go,lihuanghai/go,Charlesdong/go-1,vsdutka/go,dpatel06/go,alash3al/go,zouchao2010/go,Badredapple/go,youprofit/go,dpatel06/go,ImJasonH/go,sosop/go,shines77/go,yasarkunduz/go,cyberroadie/go,Samurais/go,Endika/go,wangfakang/go-1,dterei/go,beealone/go,theass/go,skotti/go,momchil-velikov/go,ErikDubbelboer/go,qskycolor/go,donnel6809/go,vsdutka/go,jacobsa/go,uileyar/go,fjballest/golang,vanloswang/go,GeorgiCodes/go,jdeng/go,stormltf/go,stormltf/go,jmptrader/go,famorted/go,theass/go,kevinc0825/go,skotti/go,leeric92/go,CodyGuo/go,dterei/go,devpadawan/go,andrewchambers/go,dafyddcrosby/go,NunoEdgarGub1/go,xinhuang327/go,danielsoro/go,wangfakang/go-1,CarterTsai/go,jdhenke/go,qskycolor/go,samanalysis/go,Jordanzuo/go,jasonxiong/go,baiyunping333/go,jdeng/go,parkdy/go,g522342435/go,mbrukman/go,dterei/go,jameskumar/go,Stan-Lin-/go,springning/go,goodlang/good,vanloswang/go,Badredapple/go,cyberroadie/go,devpadawan/go,albertjin/golang-go,sndnvaps/go,Stan-Lin-/go,vishsingh/go,skotti/go,andrewchambers/go,ImJasonH/go,springning/go,josharian/go,mdp/go,miolini/go,jmptrader/go,vanloswang/go,skatsuta/go,vsdutka/go,jonasi/go,sosop/go,Jordanzuo/go,momchil-velikov/go,cyberroadie/go,golang/go,ericsnowcurrently/go,rachtsingh/gogojuice,ImJasonH/go,uileyar/go,jdhenke/go,honsiorovskyi/go,Badredapple/go,famorted/go,CiscoCloud/go,ifagnosticism/go,xiuzhifu/go,jasonxiong/go,cloudrain21/go,XuYunnan/go,rachtsingh/gogojuice,jacobsa/go,monetate/go,jonahglover/go,samanalysis/go,codestation/go,Badredapple/go,suncycheng/go,dafyddcrosby/go,nawawi/go,parkdy/go,jasonxiong/go,jdeng/go,Stan-Lin-/go,stormltf/go,XuYunnan/go,devpadawan/go,shazow/go,rachtsingh/gogojuice,wangfakang/go-1,skatsuta/go,skatsuta/go,beealone/go,Charlesdong/go-1,jdeng/go,ObjectiveJoe/go,ObjectiveJoe/go,jonathanmarvens/go,baiyunping333/go,nawawi/go,danielsoro/go,rentongzhang/go,roth1002/go,golang/go,binarycrusader/go,cookerzhu/go,xiuzhifu/go,sinuos/go,gdey/go,uileyar/go,cainiaocome/go,likesea/go,qskycolor/go,andrewchambers/go,rentongzhang/go,chinanjjohn2012/go,ifagnosticism/go,CiscoCloud/go,slavau/go,wangfakang/go-1,albertjin/golang-go,sndnvaps/go,gdey/go,youprofit/go,binarycrusader/go,WIZARD-CXY/go,josharian/go,miolini/go,jacobhaven/go,danielsoro/go,vsekhar/elastic-go,shazow/go,lihuanghai/go,jdeng/go,nakedgc/go,Charlesdong/go-1,jonathanmarvens/go,fjballest/golang,snowsnail/go,shines77/go,vishsingh/go,ganboing/go-esx,xiaobodu/go,xujianhai/go,NunoEdgarGub1/go,leeric92/go,malvira/go,g522342435/go,qskycolor/go,joshsammut/go,willjunspecial/go,mbrukman/go,shines77/go,sndnvaps/go,mgyenik/go,arschles/go-1,lihuanghai/go,polyverse-security/go,vishsingh/go,gdey/go,roth1002/go,arschles/go-1,jameskumar/go,jacobsa/go,mwhudson/go,odeke-em/go,malvira/go,g522342435/go,ErikDubbelboer/go,Pulgafree/go,arschles/golang-go,CarterTsai/go,parkdy/go,stormltf/go,nakedgc/go,zhangg/go,arschles/go-1,dafyddcrosby/go,binarycrusader/go,undergrowthlinear/go,cookerzhu/go,Stan-Lin-/go,greyhwndz/go,Charlesdong/go-1,CAFxX/go,theass/go,danycoro/go,cloudrain21/go,ifagnosticism/go,zhangg/go,willjunspecial/go,Pulgafree/go,odeke-em/go,constantine001/go,Jordanzuo/go,fjballest/golang,devpadawan/go,theass/go,odeke-em/go,xiuzhifu/go,vishsingh/go,alex-zhang/go,famorted/go,constantine001/go,xiuzhifu/go,springning/go,josharian/go,kevinc0825/go,jmptrader/go,jmptrader/go,theif519/go,NunoEdgarGub1/go,zouchao2010/go,slavau/go,Pulgafree/go,CiscoCloud/go,derekmarcotte/go,devpadawan/go,jefby/go,mgyenik/go,golang/go,lihuanghai/go,jameskumar/go,donnel6809/go,odeke-em/go,b54898533/go,derekmarcotte/go,goodlang/good,albertjin/golang-go,shines77/go,alex-zhang/go,XuYunnan/go,akutz/go,willjunspecial/go,gohin/go,ganboing/go-esx,snowsnail/go,ichu501/go,deft-code/go,nawawi/go,NichoZhang/go,vanloswang/go,jefby/go,jonasi/go,yuhengye/go,snowsnail/go,cyberroadie/go,ganboing/go-esx,beealone/go,sosop/go,roth1002/go,cloudrain21/go,sndnvaps/go,mikekap/go,myPublicGit/go,springning/go,JioCloud/go,CAFxX/go,Badredapple/go,yangzhongj/go,mdp/go,kakuhiroshi/go,gohin/go,yasarkunduz/go,yasarkunduz/go,dterei/go,jdhenke/go,kim-racktop/go,cookerzhu/go,youprofit/go,undergrowthlinear/go,vsekhar/elastic-go,shines77/go,gohin/go,Young55555/go,jefby/go,JioCloud/go,linux-on-ibm-z/go,akutz/go,ganboing/go-esx,snowsnail/go,mgyenik/go,likesea/go,cyberroadie/go,ganboing/go-esx,CiscoCloud/go,alex-zhang/go,andrewchambers/go,jefby/go,nawawi/go,Jordanzuo/go,josharian/go,deft-code/go,cloudflare/go,honsiorovskyi/go,beealone/go,skotti/go,goodlang/good,mgyenik/go,xinhuang327/go,samanalysis/go,uileyar/go,willjunspecial/go,beealone/go,vsekhar/elastic-go,joshsammut/go,gohin/go,arschles/golang-go,alash3al/go,xiuzhifu/go,rachtsingh/gogojuice,Young55555/go,slavau/go,miolini/go,roth1002/go,NichoZhang/go,myPublicGit/go,danycoro/go,odeke-em/go,jmptrader/go,kakuhiroshi/go,Stan-Lin-/go,ericsnowcurrently/go,vanloswang/go,famorted/go,arschles/golang-go,leeric92/go,cloudrain21/go,snowsnail/go,codestation/go,zcwfeng/go,suncycheng/go,kakuhiroshi/go,sinuos/go,ifagnosticism/go,ifagnosticism/go,malvira/go,golang/go,miolini/go,joshsammut/go,mgyenik/go,parkdy/go,zcwfeng/go,XuYunnan/go,mbrukman/go,xinhuang327/go,jonasi/go,beealone/go,kim-racktop/go,jdhenke/go,CodyGuo/go,cainiaocome/go,ifagnosticism/go,theif519/go,ichu501/go,monetate/go,myPublicGit/go,jdeng/go,sinuos/go,sinuos/go,Samurais/go,qskycolor/go,Charlesdong/go-1,CarterTsai/go,jdhenke/go,honsiorovskyi/go,greyhwndz/go,goodlang/good,WIZARD-CXY/go,springning/go,kim-racktop/go,odeke-em/go,mikekap/go,kevinc0825/go,zcwfeng/go,4ad/go,theass/go,arschles/go-1,josharian/go,Cofyc/go,chinanjjohn2012/go,ifagnosticism/go,honsiorovskyi/go,devpadawan/go,Charlesdong/go-1,jameskumar/go,danielsoro/go,dafyddcrosby/go,qskycolor/go,xujianhai/go,4ad/go,willjunspecial/go,malvira/go,jonahglover/go,ErikDubbelboer/go,josharian/go,vishsingh/go,skatsuta/go,xiaobodu/go,deft-code/go,Cofyc/go,ErikDubbelboer/go,mwhudson/go,Badredapple/go,golang/go,slavau/go,g522342435/go,danycoro/go,jacobxk/go,jacobhaven/go,albertjin/golang-go,Stan-Lin-/go,NunoEdgarGub1/go,alex-zhang/go,jacobxk/go,ichu501/go,constantine001/go,Jordanzuo/go,donnel6809/go,4ad/go,ObjectiveJoe/go,yasarkunduz/go,springning/go,stormltf/go,sosop/go,GeorgiCodes/go,jdhenke/go,xiaobodu/go,jameskumar/go,yuhengye/go,jonahglover/go,vishsingh/go,greyhwndz/go,jacobxk/go,monetate/go,joshsammut/go,kim-racktop/go,vsdutka/go,jefby/go,shazow/go,myPublicGit/go,rachtsingh/gogojuice,alash3al/go,Badredapple/go,myPublicGit/go,b54898533/go,willjunspecial/go,zcwfeng/go,AALEKH/go,Young55555/go,donnel6809/go,Jordanzuo/go,danycoro/go,akutz/go,xiaobodu/go,sosop/go,ericsnowcurrently/go,binarycrusader/go,lihuanghai/go,willjunspecial/go,4ad/go,sosop/go,dterei/go,jefby/go,arschles/golang-go,shazow/go,xujianhai/go,xinhuang327/go,likesea/go,qskycolor/go,g522342435/go,leeric92/go,ObjectiveJoe/go,snowsnail/go,odeke-em/go,deft-code/go,baiyunping333/go,polyverse-security/go,arschles/go-1,alash3al/go,greyhwndz/go,shazow/go,Charlesdong/go-1,GeorgiCodes/go,parkdy/go,akutz/go,zouchao2010/go,jonathanmarvens/go,cloudrain21/go,g522342435/go,greyhwndz/go,jefby/go,momchil-velikov/go,youprofit/go,chinanjjohn2012/go,ifagnosticism/go,andrewchambers/go,nawawi/go,yangzhongj/go,jacobhaven/go,akutz/go,wangfakang/go-1,CiscoCloud/go,Cofyc/go,deft-code/go,miolini/go,dterei/go,dpatel06/go,deft-code/go,jacobxk/go,parkdy/go,albertjin/golang-go,CarterTsai/go,danycoro/go,Endika/go,sosop/go,nawawi/go,albertjin/golang-go,derekmarcotte/go,cyberroadie/go,skatsuta/go,Jordanzuo/go,ganboing/go-esx,zouchao2010/go,GeorgiCodes/go,sndnvaps/go,yuhengye/go,vsekhar/elastic-go,Endika/go,nawawi/go,suncycheng/go,rentongzhang/go,undergrowthlinear/go,mikekap/go,myPublicGit/go,shazow/go,ObjectiveJoe/go,jacobsa/go,mgyenik/go,jacobxk/go,linux-on-ibm-z/go,lihuanghai/go,JioCloud/go,fjballest/golang,jmptrader/go,rentongzhang/go,danycoro/go,CiscoCloud/go,theass/go,suncycheng/go,ganboing/go-esx,constantine001/go,suncycheng/go,AALEKH/go,andrewchambers/go,AALEKH/go,malvira/go,monetate/go,samanalysis/go,JioCloud/go,jameskumar/go,shines77/go,danielsoro/go,jmptrader/go,Pulgafree/go,myPublicGit/go,Young55555/go,likesea/go,NichoZhang/go,codestation/go,constantine001/go,ImJasonH/go,kim-racktop/go,XuYunnan/go,goodlang/good,CAFxX/go,roth1002/go,joshsammut/go,zhangg/go,polyverse-security/go,nakedgc/go,CodyGuo/go,odeke-em/go,devpadawan/go,joshsammut/go,jonahglover/go,gohin/go,jonathanmarvens/go,momchil-velikov/go,Young55555/go,xiaobodu/go,yuhengye/go,christopher-henderson/Go,Cofyc/go,jefby/go,ichu501/go,famorted/go,xujianhai/go,jacobhaven/go,greyhwndz/go,AALEKH/go,dpatel06/go,Pulgafree/go,roth1002/go,likesea/go,polyverse-security/go,skatsuta/go,jonasi/go,CAFxX/go,leeric92/go,Young55555/go,jasonxiong/go,JioCloud/go,CAFxX/go,uileyar/go,greyhwndz/go,slavau/go,cainiaocome/go,zcwfeng/go,famorted/go,jonasi/go,cloudflare/go,ImJasonH/go,springning/go,binarycrusader/go,jasonxiong/go,linux-on-ibm-z/go,wangfakang/go-1,derekmarcotte/go,cookerzhu/go,deft-code/go,undergrowthlinear/go,WIZARD-CXY/go,WIZARD-CXY/go,Young55555/go,jdeng/go,mbrukman/go,CAFxX/go,arschles/golang-go,jdhenke/go,derekmarcotte/go,alash3al/go,WIZARD-CXY/go,Badredapple/go,codestation/go,xinhuang327/go,undergrowthlinear/go,kevinc0825/go,donnel6809/go,qskycolor/go,skotti/go,derekmarcotte/go,slavau/go,kakuhiroshi/go,golang/go,leeric92/go,skatsuta/go,zcwfeng/go,arschles/go-1,xujianhai/go,zcwfeng/go,xinhuang327/go,samanalysis/go,AALEKH/go,gdey/go,albertjin/golang-go,kim-racktop/go,Cofyc/go,gdey/go,goodlang/good,XuYunnan/go,uileyar/go,skotti/go,snowsnail/go,zhangg/go,b54898533/go,chinanjjohn2012/go,CodyGuo/go,roth1002/go,binarycrusader/go,zhangg/go,gdey/go,Samurais/go,goodlang/good,fjballest/golang,ObjectiveJoe/go,likesea/go,gdey/go,codestation/go,momchil-velikov/go,leeric92/go,CarterTsai/go,vishsingh/go,AALEKH/go,danielsoro/go,NichoZhang/go,wangfakang/go-1,jonasi/go,sinuos/go,yangzhongj/go,codestation/go,suncycheng/go,sndnvaps/go,Samurais/go,NichoZhang/go,baiyunping333/go,devpadawan/go,polyverse-security/go,cloudflare/go,nawawi/go,mdp/go,ichu501/go,b54898533/go,vsdutka/go,alash3al/go,linux-on-ibm-z/go,vsekhar/elastic-go,malvira/go,josharian/go,undergrowthlinear/go,cookerzhu/go,parkdy/go,CiscoCloud/go,likesea/go,GeorgiCodes/go,youprofit/go,gohin/go,cainiaocome/go,jonahglover/go,Charlesdong/go-1,Pulgafree/go,CarterTsai/go,yasarkunduz/go,uileyar/go,undergrowthlinear/go,danielsoro/go,vanloswang/go,NunoEdgarGub1/go,yuhengye/go,rentongzhang/go,malvira/go,jacobsa/go,Samurais/go,rentongzhang/go,youprofit/go,samanalysis/go,yangzhongj/go,ericsnowcurrently/go,samanalysis/go,danielsoro/go,ichu501/go,ericsnowcurrently/go,baiyunping333/go,lihuanghai/go,yuhengye/go,Cofyc/go,nakedgc/go,golang/go,jacobxk/go,zouchao2010/go,wangfakang/go-1,vsekhar/elastic-go,WIZARD-CXY/go,Endika/go,lihuanghai/go,linux-on-ibm-z/go,cainiaocome/go,derekmarcotte/go,jameskumar/go,mdp/go,jacobsa/go,ericsnowcurrently/go,ErikDubbelboer/go,donnel6809/go,Stan-Lin-/go,codestation/go,jasonxiong/go,xinhuang327/go,shines77/go,dpatel06/go,mikekap/go,chinanjjohn2012/go,JioCloud/go,b54898533/go,b54898533/go,mwhudson/go,andrewchambers/go,constantine001/go,sinuos/go,joshsammut/go,monetate/go,suncycheng/go,Jordanzuo/go,CarterTsai/go,alash3al/go,malvira/go,snowsnail/go,honsiorovskyi/go,alash3al/go,greyhwndz/go,yasarkunduz/go,ErikDubbelboer/go,alex-zhang/go,linux-on-ibm-z/go,jonathanmarvens/go,sinuos/go,joshsammut/go,b54898533/go,skotti/go,albertjin/golang-go,josharian/go,jonasi/go,JioCloud/go,vsekhar/elastic-go,cookerzhu/go,rachtsingh/gogojuice,alex-zhang/go,jacobxk/go,shazow/go,NunoEdgarGub1/go,mdp/go,vsekhar/elastic-go,cloudflare/go,zouchao2010/go,ImJasonH/go,momchil-velikov/go,famorted/go,NichoZhang/go,kevinc0825/go,xiuzhifu/go,WIZARD-CXY/go,codestation/go,Stan-Lin-/go,GeorgiCodes/go,cloudflare/go,zouchao2010/go,jacobsa/go,polyverse-security/go,rachtsingh/gogojuice,binarycrusader/go,momchil-velikov/go,andrewchambers/go,golang/go,cloudrain21/go,sosop/go,ObjectiveJoe/go,polyverse-security/go,fjballest/golang,miolini/go,Endika/go,roth1002/go,xujianhai/go,sndnvaps/go,Cofyc/go,ErikDubbelboer/go,kakuhiroshi/go,samanalysis/go,leeric92/go,xiaobodu/go,stormltf/go,jdhenke/go,skatsuta/go,Young55555/go,arschles/go-1,g522342435/go,suncycheng/go,CodyGuo/go,cyberroadie/go,donnel6809/go,Endika/go,vsdutka/go,ImJasonH/go,4ad/go,jacobhaven/go,zhangg/go,b54898533/go,vanloswang/go,alex-zhang/go,theif519/go,dafyddcrosby/go,derekmarcotte/go,jacobhaven/go,monetate/go,rentongzhang/go,stormltf/go,binarycrusader/go,NichoZhang/go,dterei/go,chinanjjohn2012/go,honsiorovskyi/go,mdp/go,shines77/go,cainiaocome/go,baiyunping333/go,yangzhongj/go,cloudflare/go,rentongzhang/go,vsdutka/go,theif519/go,mikekap/go,kim-racktop/go,monetate/go,arschles/golang-go,mwhudson/go,yangzhongj/go,xujianhai/go,cloudrain21/go,jasonxiong/go,gohin/go,springning/go,jasonxiong/go,miolini/go,mwhudson/go,GeorgiCodes/go,Pulgafree/go,kakuhiroshi/go,beealone/go,theif519/go,alex-zhang/go,danycoro/go,kakuhiroshi/go,mbrukman/go,xiaobodu/go,linux-on-ibm-z/go,yasarkunduz/go,CarterTsai/go,cloudflare/go,mbrukman/go,arschles/golang-go,dpatel06/go,cookerzhu/go,goodlang/good,yangzhongj/go,Samurais/go,cyberroadie/go,jacobhaven/go,xinhuang327/go,undergrowthlinear/go,Endika/go,baiyunping333/go,kakuhiroshi/go,CiscoCloud/go,ganboing/go-esx,mwhudson/go,yuhengye/go,constantine001/go,donnel6809/go,jonasi/go,arschles/golang-go,GeorgiCodes/go,jonathanmarvens/go,slavau/go,constantine001/go,akutz/go,Cofyc/go,jonathanmarvens/go,Samurais/go,jacobhaven/go,CodyGuo/go,deft-code/go,CodyGuo/go,parkdy/go,ErikDubbelboer/go,XuYunnan/go,AALEKH/go,beealone/go,zhangg/go,polyverse-security/go,gdey/go,zouchao2010/go,cloudrain21/go,mikekap/go,g522342435/go,4ad/go,cloudflare/go,theif519/go,ImJasonH/go,dafyddcrosby/go,4ad/go,dafyddcrosby/go,xiaobodu/go,shazow/go,4ad/go,CAFxX/go,XuYunnan/go,WIZARD-CXY/go,jmptrader/go,stormltf/go,dpatel06/go,cainiaocome/go,akutz/go,honsiorovskyi/go,kevinc0825/go,ichu501/go,kim-racktop/go,Pulgafree/go,jonahglover/go,baiyunping333/go,cookerzhu/go,JioCloud/go,mdp/go,sndnvaps/go,miolini/go,nakedgc/go,jdeng/go,vanloswang/go,NunoEdgarGub1/go,kevinc0825/go,jameskumar/go,willjunspecial/go,chinanjjohn2012/go,vishsingh/go,mbrukman/go,CodyGuo/go,jonahglover/go,mgyenik/go,chinanjjohn2012/go,Samurais/go,yasarkunduz/go,nakedgc/go,yuhengye/go,mbrukman/go,nakedgc/go,xiuzhifu/go,youprofit/go,ericsnowcurrently/go,arschles/go-1,monetate/go,jacobxk/go,likesea/go,NunoEdgarGub1/go,rachtsingh/gogojuice,jonahglover/go,theass/go,fjballest/golang,kevinc0825/go,theass/go,gohin/go,myPublicGit/go,mwhudson/go,momchil-velikov/go,xiuzhifu/go,fjballest/golang,CAFxX/go,mikekap/go,theif519/go,yangzhongj/go,zhangg/go,uileyar/go,linux-on-ibm-z/go,NichoZhang/go,skotti/go,dafyddcrosby/go,cainiaocome/go,slavau/go,mdp/go,akutz/go,ericsnowcurrently/go,youprofit/go,xujianhai/go,nakedgc/go,dpatel06/go