Go Programming Language Phrasebook, The
- By David Chisnall
- Published Apr 30, 2012 by Addison-Wesley Professional. Part of the Developer's Library series.
- Copyright 2012
- Dimensions: 4-1/2" x 7"
- Pages: 288
- Edition: 1st
- ISBN-10: 0-321-81714-1
- ISBN-13: 978-0-321-81714-3
Register your product to gain access to bonus material or receive a coupon.
Product Author Bios
David Chisnall is a freelance writer and software developer, who has worked on compilers for numerous languages ranging from Smalltalk to GPU-based C++. He is an active contributor to a number of open source projects and occasionally visits academia to teach. He is the author of Cocoa Programming Developer’s Handbook (Addison-Wesley, 2009) and Objective-C Phrasebook (Addison-Wesley, 2011). He lives in Swansea, Wales.
The Go Programming Language Phrasebook
Essential Go code and idioms for all facets of the development process
This guide gives you the code “phrases” you need to quickly and effectively complete a wide variety of projects with Go, today’s most exciting new programming language.
Tested, easy-to-adapt code examples illuminate every step of Go development, helping you write highly scalable, concurrent software. You’ll master Go-specific idioms for working with strings, collections, arrays, error handling, goroutines, slices, maps, channels, numbers, dates, times, files, networking, web apps, the runtime, and more.
Concise and Accessible
Easy to carry and easy to use: Ditch all those bulky books for one portable pocket guide
Flexible and Functional
Packed with more than 100 customizable code snippets: Quickly create solid Go code to solve just about any problem
Register your book at informit.com/register for convenient access to downloads, updates, and corrections as they become available.
Download free code files here
7 of 8 people found the following review helpful
This review is from: The Go Programming Language Phrasebook (Developer's Library) (Kindle Edition)The author writes as if the reader already has experience writing in Go, and they now want to learn how to instead write idiomatically. Each section has its own code sample that the author refers to in explaining concepts. This works well if the examples are good, but otherwise it can make the section not very informative. The author often makes references and comparisons to other programming languages when explaining concepts. Without knowing all of the languages being discussed, it is quite likely the reader will not understand what is being discussed and miss the point that is trying to be made.
There is a major formatting problem with this book (as of July 9, 2012) where most of the code samples are unreadable and appear invisible on a Kindle Keyboard or in the Cloud Reader.
4 of 5 people found the following review helpful
Good book, bad edition,
This review is from: The Go Programming Language Phrasebook (Developer's Library) (Kindle Edition)The book is good. Sometimes it reminds me the classical K&R C Language bible. Unfortunately, the code snippets are missing when reading on my Kindle DX. And Amazon support was of no help in this case. I decided not to return the book anyway. It still can be read with Kindle for Macintosh.
4 of 6 people found the following review helpful
If you're only ever going to read one book about Go, read this one,
This review is from: The Go Programming Language Phrasebook (Developer's Library) (Paperback)This is the perfect introduction to the Go language with lots of references to other languages to put things in perspective.
So, if you're an experienced developer, you will very quickly grasp what Go is all about simply by knowing when and why it is similar to things you already know as well as when, why and how it is different.
The format of the book is a bit of a double edge sword. It is great if you want to carry it with you all the time, not so great when the text describes a piece of code that ends-up being printed on the back of the same page due to space constrains. Also, it may feel a bit pricey compared to "big" books.
› See all 8 customer reviews...
Online Sample Chapters
Table of Contents
1 Introducing Go 1
Go and C 1
Why Go? 4
Goroutines and Channels 7
Selecting a Compiler 10
Creating a Simple Go Program 13
The Go Type System 14
Understanding the Memory Model 16
2 A Go Primer 21
The Structure of a Go Source File 23
Declaring Variables 26
Declaring Functions 29
Looping in Go 32
Creating Enumerations 35
Declaring Structures 37
Defining Methods 39
Implementing Interfaces 42
Casting Types 47
3 Numbers 51
Converting Between Strings and Numbers 52
Using Large Integers 54
Converting Between Numbers and Pointers 56
4 Common Go Patterns 61
Zero Initialization 62
Generic Data Structures 67
Specialized Generic Data Structures 69
Implementation Hiding 72
Type Embedding 75
5 Arrays and Slices 79
Creating Arrays 81
Slicing Arrays 83
Resizing Slices 85
Truncating Slices 87
Iterating Over Arrays 88
6 Manipulating Strings 91
Comparing Strings 92
Processing a String One Character at a Time 94
Processing a Partial String 96
Splitting and Trimming Strings 98
Copying Strings 102
Creating Strings from Patterns 102
Matching Patterns in Strings 104
7 Working with Collections 107
Creating a Map 108
Storing Unordered Groups of Objects 111
Using Lists 112
Defining New Collections 114
8 Handling Errors 117
Deferring Cleanup 118
Panicking and Recovering 121
Returning Error Values 125
Error Delegates 127
9 Goroutines 131
Creating Goroutines 131
Synchronizing Goroutines 134
Waiting for a Condition 137
Performing Thread-Safe Initialization 140
Performing Actions in the Background 142
Communicating Via Channels 144
Using Multiple Channels 148
10 Concurrency Design Patterns 151
Timing Out Connections 152
Aliased xor Mutable 154
Share Memory by Communicating 156
Transactions by Sharing Channels 159
Concurrent Objects 162
Implementing Futures in Go 164
Coalescing Events 166
Map Reduce, Go Style 168
11 Dates and Times 175
Finding the Current Date 176
Converting Dates for Display 177
Parsing Dates from Strings 179
Calculating Elapsed Time 180
Receiving Timer Events 181
12 Accessing Files and the Environment 183
Manipulating Paths 184
Reading a File 186
Reading One Line at a Time 188
Determining if a File or Directory Exists 190
Checking Environment Variables 192
13 Network Access 195
Connecting to Servers 196
Distributing Go 199
Serving Objects 204
Calling Remote Procedures 206
14 Web Applications 207
Integrating with a Web Server 208
Connecting to Web Servers 211
Parsing HTML 213
Generating HTML 216
15 Interacting with the Go Runtime 219
Finding the Type of a Variable 220
Finalizing Structures 223
Copying Arbitrary Types 226
Constructing Function Calls 228
Calling C Functions 230
16 Distributing Go Code 233
Installing Third-Party Packages 234
Creating Packages 236
Documenting Your Code 240
Staying Up to Date 241
17 Debugging Go 243
Using a Debugger 243
Misunderstanding Memory Ordering 247
Spotting Concurrency Bugs 249
Restricting Behavior 252
Building Unit Tests 257
Download the sample pages (includes Chapter 2 and Index)
Book + eBook Bundle
Book Price $23.99
eBook Price $8.40
eBook formats included
This book includes free shipping!
This book includes free shipping!
Includes EPUB, MOBI, and PDF
About eBook Formats
This eBook includes the following formats, accessible from your Account page after purchase:
EPUBThe open industry format known for its reflowable content and usability on supported mobile devices.
MOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.
PDFThe popular standard, used most often with the free Adobe® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.