内容简介
Go编程语言,通常也称为Golang(尽管这种叫法并不对),借助一些大师级开发作品以及伟大的编程思想的高屋建瓴。着实取得了长足进步。Shopify的首席执行官TobiasLutke近便声称“Go将成为未来的服务器语言”,掷地有声,雄心勃勃。Go程序员的需求量正处于高位,但更有争议的是,Go走上了以前由C和Unix程序员的舞台。
Go语言的成长使其能够实现系统、网络、Web以及云应用。只要熟悉了语法,掌握库的使用并利用其语言特性、速度和效率,你将受益无穷,Go生态学正是因此而闻名。
你多少已经知道了点Go语言的语法,也编写了一些小项目,而大多数Go程序员都面临着将Go语言技能与生产代码结合的难题。对Go编程的典型介绍往往是浅尝辄止,而《精通Go语言(影印版英文版)》作者将继续告诉你如何解决这个问题。
《精通Go语言(影印版英文版)》提供了Go的概要,介绍了Go的实现,还有专门一章深入解释了并发、系统以及网络编程,这对于现代的原生云开发是必不可少的,读者也将从中受益。作者简介
米哈里斯·图卡洛斯(MihalisTsoukalos),isatechnicalauthor,aUnixadministrator,adeveloper,andamathematician,whoenjoyslearningnewthings.Hehaswrittenmorethan250technicalarticlesformanypublications,includingSysAdmin,MacTech,LinuxUserandDeveloper,Usenix;login:,LinuxFormat,andLinuxJournal.目录
Preface
Chapter1:GoandtheOperatingSystem
Thestructureofthebook
ThehistoryofGo
WhylearnGo?
Goadvantages
IsGoperfect?
Whatisapreprocessor?
Thegodocutility
CompilingGocode
ExecutingGocode
TwoGorules
YoueitheruseaGopackageordonotincludeit
Thereisonlyonewaytoformatcurlybraces
DownloadingGopackages
Unixstalin,stdout,andstderr
Aboutprintingoutput
Usingstandardoutput
Gettinguserinput
About:=and=
Readingfromstandardinput
Workingwithcommand-linearguments
Abouterroroutput
Writingtologfiles
Logginglevels
Loggingfacilities
Logservers
AGoprogramthatsendsinformationtologfiles
Aboutlog.Fatal()
Aboutlog.Panic()
ErrorhandlinginGo
Theerrordatatype
Errorhandling
Additionalresources
Exercises
Summary
Chapter2:UnderstandingGoInternals
TheGocompiler
GarbageCollection
TheTricoloralgorithm
MoreabouttheoperationoftheGoGarbageCollector
Unsafecode
Abouttheunsafepackage
Anotherexampleoftheunsafepackage
CallingCcodefromGo
CallingCcodefromGousingthesamefile
CallingCcodefromGousingseparatefiles
TheCcode
TheGocode
MixingGoandCcode
CallingGofunctionsfromCcode
TheGopackage
TheCcode
Thedeferkeyword
PanicandRecover
Usingthepanicfunctiononitsown
TwohandyUnixutilities
Thestracetool
Thedtracetool
YourGoenvironment
TheGoAssembler
NodeTrees
Learningmoreaboutgobuild
GeneralGocodingadvices
AdditionalResources
Exercises
Summary
Chapter3:WorkingwithBasicGoDataTypes
Goloops
Theforloop
Thewhileloop
Therangekeyword
ExamplesofGoforloops
Goarrays
Multi-dimensionalarrays
TheshortcomingsofGoarrays
Goslices
Performingbasicoperationsonslices
Slicesarebeingexpandedautomatically
Byteslices
Chapter4:TheUsesofCompositeTypes
Chapter5:EnhancingGoCodewithDataStructures
Chapter6:WhatYouMightNotKnowAboutGoPackages
Chapter7:ReflectionandInterfacesforAllSeasons
Chapter8:TellingaUnixSystemWhattoDo
Chapter9:GoConcurrency-Goroutines,Channels,andPipelines
Chapter10:GoConcurrency-AdvancedTopics
Chapter11:CodeTesting,Optimization,andProfiling
Chapter12:TheFoundationsofNetworkProgramminginGo
Chapter13:NetworkProgramming-BuildingServersandClients
OtherBooksYouMayEnjoy
Index