Getting started
Go begins as one file and one command. These lessons install the toolchain and put it in front of an editor, then build the first programs: a module and its packages, variables and constants, the types and their zero values, and the conditions a program branches on. The part ends at switch, which needs no break.
1.1
What Go is and where it runs
the language, a static binary, the garbage collector, go run against go build, and the programs Go runs in
Open
1.2
Install Go on Linux, macOS and Windows
the archives and packages per system, PATH, go version, the module proxy and the version this course uses
Open
1.3
An editor, gofmt, go vet and go doc
the edit-build-run loop, gofmt, go vet, go doc and the tools this image does not have
Open
1.4
Your first Go program
hello.go line by line, go run, go build, the exit status and a missing import
Open
1.5
A module, go.mod and module paths
go mod init, the go directive, a module path, a package inside the module and go.sum
Open
1.6
Packages, imports and visibility
the package clause, imports, exported names, the internal folder and init
Open
1.7
Variables, short declarations and zero values
var, :=, the zero value of every type, scope, shadowing and the unused-variable error
Open
1.8
Constants, iota and typed constants
const, untyped constants, iota, typed constants and what the compiler folds
Open
1.9
Types, named types and conversions
named types, the underlying type, conversions, type aliases and when a conversion is needed
Open
1.10
Integers, floats and overflow
the integer widths, division and remainder, floats, NaN, overflow and the math package
Open
1.11
Operators, bits and comparisons
arithmetic, bitwise operators, comparisons, logic, precedence and the shift rules
Open
1.12
Conditions, switch and case lists
if with an init statement, switch without fallthrough, case lists, type switches named and the missing-condition error
Open