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 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.
- 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.
2. An Introduction to Programming in Go by Caleb Doxsey
As the title suggests, this is a short, concise introduction to computer programming using the language Go.
- 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.
3. Building Web Apps with Go by Jeremy Saenz
Building 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.
- 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.
4. Build Web Application with Golang by Astaxie
This 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.
- 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.
All books in this series:
|Free Programming Books
|ALGOL-like programming language, extended from Pascal and other languages
|Dependently typed functional language based on intuitionistic Type Theory
|Inexpensive, flexible, open source microcontroller platform
|As close to writing machine code without writing in pure hexadecimal
|Versatile language designed for pattern scanning and processing language
|Shell and command language; popular both as a shell and a scripting language
|Beginner’s All-purpose Symbolic Instruction Code
|General-purpose, procedural, portable, high-level language
|General-purpose, portable, free-form, multi-paradigm language
|Combines the power and flexibility of C++ with the simplicity of Visual Basic
|Dialect of the Lisp programming language
|Common Business-Oriented Language
|Dependently typed language similar to Agda, Idris, F* and others
|General-purpose, concurrent, multi-paradigm, object-oriented language
|CSS (Cascading Style Sheets) specifies a web page’s appearance
|General-purpose systems programming language with a C-like syntax
|Client-optimized language for fast apps on multiple platforms
|Multi-paradigm language supporting functional and object-oriented coding
|Best known as the language embedded in web browsers
|Object-oriented language designed by Bertrand Meyer
|Relatively new functional language running on the Erlang virtual machine
|General-purpose, concurrent, declarative, functional language
|Uses functional, imperative, and object-oriented programming methods
|Dynamic stack-based programming language
|Imperative stack-based programming language
|The first high-level language, using the first compiler
|Compiled, statically typed programming language
|Powerful, optionally typed and dynamic language
|Standardized, general-purpose, polymorphically, statically typed language
|HyperText Markup Language
|Wide variety of features for processing and presenting symbolic data
|Array programming language based primarily on APL
|General-purpose, concurrent, class-based, object-oriented, high-level language
|Interpreted, prototype-based, scripting language
|High-level, high-performance language for technical computing
|More modern version of Java
|Designed to enable domain experts to build power systems quickly
|Professional document preparation system and document markup language
|Unique features - excellent to study programming constructs
|Dialect of Lisp that features interactivity, modularity, extensibility
|Designed as an embeddable scripting language
|Plain text formatting syntax designed to be easy-to-read and easy-to-write
|Object-oriented language that adds Smalltalk-style messaging to C
|The main implementation of the Caml language
|Imperative and procedural language designed in the late 1960s
|High-level, general-purpose, interpreted, scripting, dynamic language
|PHP has been at the helm of the web for many years
|Interpreted, stack-based and Turing complete language
|A general purpose, declarative, logic programming language
|General-purpose, structured, powerful language
|Hierarchical declarative language for user interface layout - JSON-like syntax
|De facto standard among statisticians and data analysts
|General-purpose, object-oriented, multi-paradigm, functional language
|Member of the Perl family of programming languages
|General purpose, scripting, structured, flexible, fully object-oriented language
|Ideal for systems, embedded, and other performance critical code
|Modern, object-functional, multi-paradigm, Java-based language
|A general-purpose, functional language descended from Lisp and Algol
|Visual programming language designed for 8-16 year-old children
|Access and manipulate data held in a relational database management system
|General-purpose functional language characterized as "Lisp with types"
|Powerful and intuitive general-purpose programming language
|Dynamic language based on concepts of Lisp, C, and Unix shells
|Markup and programming language - create professional quality typeset text
|Object-oriented language, syntactically similar to C#
|Hardware description language used in electronic design automation
|Powerful scripting language of the Vim editor
|Rules for defining semantic tags describing structure ad meaning