Go編程語言,通常也稱為Golang(盡管這種叫法并不對),借助一些大師級開發(fā)作品以及偉大的編程思想的高屋建瓴。著實取得了長足進步。Shopify的首席執(zhí)行官TobiasLutke近便聲稱“Go將成為未來的服務器語言”,擲地有聲,雄心勃勃。Go程序員的需求量正處于高位,但更有爭議的是,Go走上了以前由C和Unix程序員的舞臺。
Go語言的成長使其能夠實現(xiàn)系統(tǒng)、網(wǎng)絡、Web以及云應用。只要熟悉了語法,掌握庫的使用并利用其語言特性、速度和效率,你將受益無窮,Go生態(tài)學正是因此而聞名。
你多少已經(jīng)知道了點Go語言的語法,也編寫了一些小項目,而大多數(shù)Go程序員都面臨著將Go語言技能與生產(chǎn)代碼結合的難題。對Go編程的典型介紹往往是淺嘗輒止,而《精通Go語言(影印版 英文版)》作者將繼續(xù)告訴你如何解決這個問題。
《精通Go語言(影印版 英文版)》提供了Go的概要,介紹了Go的實現(xiàn),還有專門一章深入解釋了并發(fā)、系統(tǒng)以及網(wǎng)絡編程,這對于現(xiàn)代的原生云開發(fā)是必不可少的,讀者也將從中受益。
米哈里斯·圖卡洛斯(Mihalis Tsoukalos),is a technical author, a Unix administrator, a developer, and a mathematician, who enjoys learning new things. He has written more than 250 technical articles for many publications, including Sys Admin, MacTech, Linux User and Developer,Usenix ;login:, Linux Format, and Linux Journal.
Preface
Chapter 1: Go and the Operating System
The structure of the book
The history of Go
Why learn Go?
Go advantages
Is Go perfect?
What is a preprocessor?
The godoc utility
Compiling Go code
Executing Go code
Two Go rules
You either use a Go package or do not include it
There is only one way to format curly braces
Downloading Go packages
Unix stalin, stdout, and stderr
About printing output
Using standard output
Getting user input
About := and =
Reading from standard input
Working with command-line arguments
About error output
Writing to log files
Logging levels
Logging facilities
Log servers
A Go program that sends information to log files
About log.Fatal()
About log.Panic()
Error handling in Go
The error data type
Error handling
Additional resources
Exercises
Summary
Chapter 2: Understanding Go Internals
The Go compiler
Garbage Collection
The Tricolor algorithm
More about the operation of the Go Garbage Collector
Unsafe code
About the unsafe package
Another example of the unsafe package
Calling C code from Go
Calling C code from Go using the same file
Calling C code from Go using separate files
The C code
The Go code
Mixing Go and C code
Calling Go functions from C code
The Go package
The C code
The defer keyword
Panic and Recover
Using the panic function on its own
Two handy Unix utilities
The strace tool
The dtrace tool
Your Go environment
The Go Assembler
Node Trees
Learning more about go build
General Go coding advices
Additional Resources
Exercises
Summary
Chapter 3: Working with Basic Go Data Types
Go loops
The for loop
The while loop
The range keyword
Examples of Go for loops
Go arrays
Multi-dimensional arrays
The shortcomings of Go arrays
Go slices
Performing basic operations on slices
Slices are being expanded automatically
Byte slices
Chapter 4: The Uses of Composite Types
Chapter 5: Enhancing Go Code with Data Structures
Chapter 6: What You Might Not Know About Go Packages
Chapter 7: Reflection and Interfaces for All Seasons
Chapter 8: Telling a Unix System What to Do
Chapter 9: Go Concurrency - Goroutines, Channels, and Pipelines
Chapter 10: Go Concurrency- Advanced Topics
Chapter 11: Code Testing, Optimization, and Profiling
Chapter 12: The Foundations of Network Programming in Go
Chapter 13: Network Programming - Building Servers and Clients
Other Books You May Enjoy
Index