O'Reilly logo

Introducing Go by Caleb Doxsey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required


Although originally designed by Google for the kinds of problems Google works on—large, distributed network applications—Go is now a general-purpose programming language useful in a wide variety of software domains. Many companies have started using Go because of its simplicity, ease of use, performance, low barrier of entry, and powerful tooling.

This book was written to help new programmers learn Go. Although there is an abundance of technical resources available for Go, most are geared toward experienced engineers. My goal here is to provide a more gentle introduction to the language.

Who Should Read This Book

This book is written for relatively inexperienced programmers who know nothing about Go. Although not exhaustive, it does cover all of the basics, and should leave you well positioned to tackle the more advanced material available on the language. The book also covers rudimentary programming skills via the exercises at the end of each chapter.

Navigating This Book

This book is organized as follows:

  • Chapters 1 through 4 introduce the Go toolset and the basics of the language

  • Chapters 5 through 7 describe more complex types and functions

  • Chapters 8 and 9 describe packages and testing

  • Chapter 10 introduces concurrency

For best results, the book should be read in order, as each chapter builds on the concepts covered in the preceding chapters. Each chapter ends with a set of exercises, and it’s important to actually complete them—it’s by solving problems like these that you learn to program. In particular, typing out the examples (and not just reading them) can help significantly.

Online Resources

You’ll want to check out the following resources:

Conventions Used in This Book

The following typographical conventions are used in this book:


Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Using Code Examples

This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Introducing Go by Caleb Doxsey (O’Reilly). Copyright 2016 Caleb Doxsey, 978-1-4919-4195-9.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari® Books Online


Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of plans and pricing for enterprise, government, education, and individuals.

Members have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and hundreds more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

  • O’Reilly Media, Inc.
  • 1005 Gravenstein Highway North
  • Sebastopol, CA 95472
  • 800-998-9938 (in the United States or Canada)
  • 707-829-0515 (international or local)
  • 707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at bit.ly/introducing-go.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required