The Go Programming Language Phrasebook

Overview

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. ...

See more details below
Paperback (New Edition)
$24.40
BN.com price
(Save 18%)$29.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (9) from $20.15   
  • New (6) from $21.71   
  • Used (3) from $20.15   
The Go Programming Language Phrasebook

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$13.49
BN.com price
(Save 43%)$23.99 List Price

Overview

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.

Read More Show Less

Product Details

  • ISBN-13: 9780321817143
  • Publisher: Addison-Wesley
  • Publication date: 5/14/2012
  • Series: Developer's Library Series
  • Edition description: New Edition
  • Edition number: 1
  • Pages: 288
  • Sales rank: 661,109
  • Product dimensions: 4.50 (w) x 7.10 (h) x 0.80 (d)

Meet the Author

David Chisnall is author of Objective-C Phrasebook, Second Edition. He is an active contributor to the GNUstep project and cofounded the Étoilé project to build a desktop environment atop GNUstep. Chisnall has written several articles for informIT.com including a three-part series on Go for Objective-C Programmers.

Read More Show Less

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

Index 259

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)