go
Go: What It Is and Why It's Worth Learning
What Go is, what makes it different from Python and C++, and why so much DevOps tooling is written in it. The first post in a hands-on series that works up to a small web server and a DNS checker.
go
What Go is, what makes it different from Python and C++, and why so much DevOps tooling is written in it. The first post in a hands-on series that works up to a small web server and a DNS checker.
go
The three parts every Go file has, what packages and modules are, and how to run and build a program with go run and go build.
go
The four ways to declare a variable in Go, what zero values are, how to print with Println, Printf and Sprintf, and the two kinds of comments.
go
The basic types in Go (integers, floats, booleans and strings), how big each one is, what a rune and a byte are, and why 0.1 + 0.2 is not 0.3.
go
The escape sequences Go accepts in strings and runes, which ones are only valid in one of the two, and how raw strings let you skip escaping altogether.
go
Where a variable is visible in Go, the shadowing mistake that catches beginners, why Go has no implicit type conversion, and how typed constants, untyped constants and iota work.
go
Arithmetic, comparison, logical, assignment and bitwise operators in Go, how integer division and the remainder operator behave, and the operators Go deliberately leaves out, such as the ternary.
go
How Go makes decisions and repeats work: if with an init statement, switch without fall-through, the single for loop in its four forms, break and continue, and defer.
go
How arrays work in Go: fixed size that is part of the type, zero values, indexing and bounds checks, and why assigning or passing an array copies it.
go
What a slice really is (a pointer, a length and a capacity over an array), how slicing shares memory, how append grows a slice, and the aliasing bug that follows.
go
How Go maps store key-value pairs, why writing to a nil map panics, how to check whether a key exists, why iteration order is random, and what a map can use as a key.
go
Declaring functions in Go, returning several values, the error-return idiom, variadic functions, closures and functions as values, and why Go passes everything by value.
go
What a pointer is, how & and * work, why a function needs a pointer to change its caller's variable, what a nil pointer does, and when pointers are worth using.
go
Group data with structs, attach behaviour with methods, choose between value and pointer receivers, describe behaviour with interfaces, and reuse code by embedding instead of inheriting.
go
Build a small Go web server that serves static files, handles a form and responds to a simple route, using only the standard library's net/http package.
go
Build a small Go command-line tool that checks a domain's MX, SPF and DMARC records with the standard library's net package, and learn what each record means.