Programming Books

12 Excellent Free Books to Learn Go

Last Updated on June 12, 2023

Go is a compiled, statically typed programming language that makes it easy to build simple, reliable, and efficient software. It’s a general purpose programming language with modern features, clean syntax and a robust well-documented common library, making it a good candidate to learn as your first programming language. While it borrows ideas from other languages such as Algol and C, it has a very different character. It’s sometimes described as a simple language.

Go is an open source project developed by a team at Google and many contributors from the open source community. Go’s first release was in 2009, and it’s distributed under a BSD-style license.

This article selects the best open source books that will give readers a firm foundation in developing Go applications. There are also some books included that aren’t published under an open source license.

1. Go Bootcamp by Matt Aimonetti

Go BootcampGo Bootcamp – Everything you need to know to get started with Go teachers the reader, among other things, the pros and cons of static typing, what makes the language unique, what Go is good at, and what are the challenging aspects of the language.

The book offers exercises to help cement the knowledge learned.

This companion book contains material initially written specifically for this event as well as content from Google & the Go team under Creative Commons Attribution 3.0 License and code licensed under a BSD license. The rest of the content is also provided under Creative Commons Attribution 3.0 License.

Chapters include:

  • The Basics – looks at variables and inferred typing, constants, printing constants and variables, packages and imports, code location, exported names, and more.
  • Types – includes structs, initializing, composition vs inheritance and more.
  • Collection Types – arrays including multi-dimensional arrays, slices, range, and maps are explored.
  • Control flow – if statement, for loop, and switch case statement are covered.
  • Methods – types and methods allow for an object-oriented style of programming.
  • Interfaces – an interface type is defined by a set of methods. A value of interface type can hold any value that implements those methods.
  • Concurrency – explores one of the most interesting aspects of the Go language.
  • Get Setup – focuses on OS X.
  • Get Your Feet Wet.
  • Tips and Tricks – shares some tricks experienced developers discovered over time.

Read the book

2. An Introduction to Programming in Go by Caleb Doxsey

An Introduction to Programming in GoAs the title suggests, this is a short, concise introduction to computer programming using the language Go.

Chapters cover:

  • Getting Started – covers files and folders, the terminal, text editors, and Go tools.
  • Your First Program – the obligatory “Hello World”.
  • Types – built-in data types: Numbers, Strings, and Booleans.
  • Variables – covers how to name a variable, scope, constants, defining multiple variables, and closing with an example program.
  • Control Structures – start to write useful programs by learning about control structures: for, if, and switch.
  • Arrays, Slices and Maps – looks at three more built-in types: arrays, slices and maps.
  • Functions – an independent section of code that maps zero or more input parameters to zero or more output parameters.
  • Pointers – examines the * and & operators, and new.
  • Structs and Interfaces – a struct is a type which contains named fields. For interfaces, the chapter explains the “method set”.
  • Concurrency – Go has rich support for concurrency using goroutines and channels.
  • Packages – another mechanism for code reuse.
  • Testing – Go includes a special program that makes writing tests easier.
  • The Core Packages – takes a look at some of the most commonly used packages included with Go.

The online version of the book is available under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. There is an updated version of the book available to purchase.

Read the book

3. Building Web Apps with Go by Jeremy Saenz

Building Web Apps with GoBuilding Web Apps with Go is a succinct 39 page book.

The book covers a wide array of web topics.

Most of the material uses the built in packages from the standard library.

Some lessons need a third party package.

This book is licensed under the CC BY-SA 3.0 License, the code is licensed under a BSD 3-Clause License, unless otherwise specified. There are portions of this book that are incomplete.

Chapters include:

  • Go Makes Things Simple.
  • The net/http package – starts with a brief overview of HTTP before moving on to explore an important package, net/http.
  • Creating a Basic Web App – in Go.
  • Deployment – deploy a web application to Heroku.
  • URL Routing – creates some routing for a RESTful resource called “posts”.
  • Middleware – shows how to use a Negroni stack with the built in middleware and how to create your own custom middleware.
  • Rendering – learn how render HTML and JSON using the methods offered in Go’s standard library.
  • Testing – covers the unit-test style approach and an end-to-end approach.
  • Controllers – illustrates the benefits in using a controller model.
  • Databases – connect to a SQLite database.
  • Tips and Tricks.

Read the book

4. Build Web Application with Golang by Astaxie

Build Web Application GolangThis book describes how to develop web application in Go, introducing a lot of basic knowledge, development tools and techniques. The book uses this knowledge to implement a simple web framework.

Chapters include:

  • Go basic knowledge.
  • Web foundation – talks about some concepts of the web and how to run web applications in Go.
  • HTTP Form – how to handle form data in Go, and how to validate form data.
  • Database – examines the database driver interface design in Go, before moving on to introducing SQM database drivers Go, and then presenting the ORM.
  • Data Storage and session – highlights the differences between cookies and sessions, session hijacking, and how to prevent it.
  • Text files – XML, JSON, regular expressions, the MVC pattern to develop applications in Go, ending with an introduction to file and folder operations.
  • Web services – Sockets, WebSocket, REST, and RPC are covered.
  • Security and encryption – CSRF attacks, filter inputs, XSS attacks, SQL injection, password storage, and encrypting and decrypting data.
  • Internationalization and localization – time zone, localized resources, and international sites.
  • Error handling, debugging and testing – describes how to handle errors in the Go language and how to design your own handling package and functions, how to use GDB to debug programs under dynamic operating conditions. The chapter moves on to explaining unit testing and in-depth discussions and examples on how to write unit tests.
  • Deployment and maintenance – logs, errors and crashes, deployment, and backup and recovery.
  • Build a web framework – introduces the MVC architecture, a routing and logging system and simple server configuration.
  • Develop web framework.

This book is licensed under the CC BY-SA 3.0 License, the code is licensed under a BSD 3-Clause License, unless otherwise specified.

Read the book

Next page: Page 2 – Learning Go and more books

Pages in this article:
Page 1 – Go Bootcamp and more books
Page 2 – Learning Go and more books
Page 3 – Go 101 and more books

All books in this series:

Free Programming Books
AdaALGOL-like programming language, extended from Pascal and other languages
AgdaDependently typed functional language based on intuitionistic Type Theory
ArduinoInexpensive, flexible, open source microcontroller platform
AssemblyAs close to writing machine code without writing in pure hexadecimal
AwkVersatile language designed for pattern scanning and processing language
BashShell and command language; popular both as a shell and a scripting language
BASICBeginner’s All-purpose Symbolic Instruction Code
CGeneral-purpose, procedural, portable, high-level language
C++General-purpose, portable, free-form, multi-paradigm language
C#Combines the power and flexibility of C++ with the simplicity of Visual Basic
ClojureDialect of the Lisp programming language
ClojureScriptCompiler for Clojure that targets JavaScript
COBOLCommon Business-Oriented Language
CoffeeScriptTranscompiles into JavaScript inspired by Ruby, Python and Haskell
CoqDependently typed language similar to Agda, Idris, F* and others
CrystalGeneral-purpose, concurrent, multi-paradigm, object-oriented language
CSSCSS (Cascading Style Sheets) specifies a web page’s appearance
DGeneral-purpose systems programming language with a C-like syntax
DartClient-optimized language for fast apps on multiple platforms
DylanMulti-paradigm language supporting functional and object-oriented coding
ECMAScriptBest known as the language embedded in web browsers
EiffelObject-oriented language designed by Bertrand Meyer
ElixirRelatively new functional language running on the Erlang virtual machine
ErlangGeneral-purpose, concurrent, declarative, functional language
F#Uses functional, imperative, and object-oriented programming methods
FactorDynamic stack-based programming language
ForthImperative stack-based programming language
FortranThe first high-level language, using the first compiler
GoCompiled, statically typed programming language
GroovyPowerful, optionally typed and dynamic language
HaskellStandardized, general-purpose, polymorphically, statically typed language
HTMLHyperText Markup Language
IconWide variety of features for processing and presenting symbolic data
JArray programming language based primarily on APL
JavaGeneral-purpose, concurrent, class-based, object-oriented, high-level language
JavaScriptInterpreted, prototype-based, scripting language
JuliaHigh-level, high-performance language for technical computing
KotlinMore modern version of Java
LabVIEWDesigned to enable domain experts to build power systems quickly
LaTeXProfessional document preparation system and document markup language
LispUnique features - excellent to study programming constructs
LogoDialect of Lisp that features interactivity, modularity, extensibility
LuaDesigned as an embeddable scripting language
MarkdownPlain text formatting syntax designed to be easy-to-read and easy-to-write
Objective-CObject-oriented language that adds Smalltalk-style messaging to C
OCamlThe main implementation of the Caml language
PascalImperative and procedural language designed in the late 1960s
PerlHigh-level, general-purpose, interpreted, scripting, dynamic language
PHPPHP has been at the helm of the web for many years
PostScriptInterpreted, stack-based and Turing complete language
PrologA general purpose, declarative, logic programming language
PureScriptSmall strongly, statically typed language compiling to JavaScript
PythonGeneral-purpose, structured, powerful language
QMLHierarchical declarative language for user interface layout - JSON-like syntax
RDe facto standard among statisticians and data analysts
RacketGeneral-purpose, object-oriented, multi-paradigm, functional language
RakuMember of the Perl family of programming languages
RubyGeneral purpose, scripting, structured, flexible, fully object-oriented language
RustIdeal for systems, embedded, and other performance critical code
ScalaModern, object-functional, multi-paradigm, Java-based language
SchemeA general-purpose, functional language descended from Lisp and Algol
ScratchVisual programming language designed for 8-16 year-old children
SQLAccess and manipulate data held in a relational database management system
Standard MLGeneral-purpose functional language characterized as "Lisp with types"
SwiftPowerful and intuitive general-purpose programming language
TclDynamic language based on concepts of Lisp, C, and Unix shells
TeXMarkup and programming language - create professional quality typeset text
TypeScriptStrict syntactical superset of JavaScript adding optional static typing
ValaObject-oriented language, syntactically similar to C#
VHDLHardware description language used in electronic design automation
VimLPowerful scripting language of the Vim editor
XMLRules for defining semantic tags describing structure ad meaning
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments