Go Fundamentals
Go is a compiled, strongly typed programming language for building reliable software. It organizes code into packages and includes built-in tools for formatting, testing, dependency management, and concurrency.
itProgramming languages | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Go Fundamentals
Go is a compiled programming language that arrives with a unusually complete set of tools and an opinion about how a project is arranged. A module contains packages, packages contain source files, and the go command keeps the whole arrangement from turning into a drawer of cables. That is already more useful than it sounds.
Start with the module: a versioned collection of related packages rooted at go.mod. A package is the smaller unit that compiles together. An executable is merely the package named main with a main function, which is Go's quiet way of saying that programs ought to announce where they begin. Names beginning with uppercase letters cross package boundaries; lower-case names stay private. The language has no class inheritance waiting behind a curtain. It prefers structs, methods, and small interfaces that describe behavior.
The first surprise is that Go gives every variable a zero value. Numbers begin at zero, strings begin empty, and several useful-looking things begin as nil. This is convenient until a nil map receives a write and objects on principle. Slices are similarly sociable: two slices can share underlying storage, so a change through one can appear through another. The compact syntax does not remove the need to know who owns a value.
Then comes concurrency, where Go is cheerful enough to hand you goroutines and channels before asking whether any of them know when to stop. A goroutine runs concurrently. A channel carries typed values between goroutines. Neither makes shared mutable data safe, and neither cancels work by magic. Define ownership, cancellation, and completion before adding the clever part. The race detector is a useful alarm, not a substitute for a plan.
Errors are values, so handle them where there is context to add or a decision to make. defer schedules cleanup when a function returns, which keeps successful acquisition and cleanup near each other. The daily ritual is refreshingly plain: format, test, inspect, build. go mod tidy keeps dependency requirements aligned with imports, because even tidy languages have paperwork.
Read the intro for the full map of types, packages, interfaces, and concurrency. Use the slides when the relationships need to fit on one screen. Keep the cheatsheet beside a small module while the commands and zero values are still unfamiliar. The reference path then leads from the Tour to the specification, where the precise rules wait patiently and without sympathy.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://go.dev/ref/spec
Supports
- Strong typing, garbage collection, packages, declarations, types, zero values, and control flow
- Arrays, slices, maps, strings, pointers, methods, interfaces, goroutines, channels, and select
- Exact rules behind every quiz answer that cites the language specification
- https://go.dev/doc/tutorial/getting-started
Supports
- Installing Go, creating go.mod, package main, func main, imports, go run, and go mod tidy
- Module paths, external packages, pkg.go.dev discovery, and the introductory reference rationale
- https://go.dev/doc/code
Supports
- Modules, packages, source-file organization, import paths, commands, the go tool, and tests
- The How to Write Go Code reference rationale and module quiz answer
- https://go.dev/doc/tutorial/
Supports
- Official progression through modules, workspaces, databases, APIs, generics, fuzzing, vulnerabilities, and A Tour of Go
- The Tour rationale covering syntax, data structures, methods, interfaces, and concurrency primitives
- https://go.dev/doc/effective_go
Supports
- Formatting, naming, exported identifiers, control flow, defer, methods, interfaces, errors, and concurrency
- The document's own warning about gaps in newer language, module, and library features
- https://go.dev/doc/modules/managing-dependencies
Supports
- Dependency requirements, versions, go get, go mod tidy, and module maintenance
- https://pkg.go.dev/testing
Supports
- Test file and function conventions, testing.T, benchmarks, fuzz targets, and test execution
- https://pkg.go.dev/context
Supports
- Cancellation, deadlines, request-scoped values, API placement, and calling cancellation functions
- The goroutine-lifetime quiz answer
- https://go.dev/doc/faq
Supports
- Interface values that hold typed nil pointers
- Language design boundaries and practical Go behavior
- https://pkg.go.dev/std
Supports
- Maintained standard-library API documentation and examples
- The standard-library reference rationale
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the Awesome Go list under programming languages
- https://github.com/avelino/awesome-go
Supports
- Curated inclusion of GolangCI-Lint as a linters runner
- Curated inclusion of Delve as a Go debugger
- Curated inclusion of GoReleaser as a Go binary delivery tool
- https://golangci-lint.run/docs/
Supports
- Linters, formatters, configuration, and getting-started coverage
- The GolangCI-Lint awesome-link rationale
- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv.md
Supports
- Source-level debugging, execution control, variable evaluation, and goroutine-state inspection
- The Delve awesome-link rationale
- https://www.goreleaser.com/getting-started/quick-start/
Supports
- Release configuration, validation, builds, archives, and publishing
- The GoReleaser awesome-link rationale
- https://go.dev/blog/toward-go2
Supports
- The 2007 naming and design origin of Go
- https://go.dev/blog/1year
Supports
- The 2009 public open-source release
- https://go.dev/blog/go1
Supports
- The 2012 Go 1 release and compatibility commitment
- https://go.dev/doc/go1.2
Supports
- The Go 1.2 race detector milestone
- https://go.dev/blog/go1.5
Supports
- The self-hosted compiler, garbage collector, scheduler, and tooling changes in Go 1.5
- https://go.dev/doc/go1.11
Supports
- The introduction of Go modules as an alternative to GOPATH
- https://go.dev/doc/go1.14
Supports
- Go modules being ready for production use
- https://go.dev/doc/go1.18
Supports
- Type parameters, fuzzing, and workspace mode in Go 1.18
- https://go.dev/doc/go1.21
Supports
- Profile-guided optimization and related toolchain changes in Go 1.21
- https://gin-gonic.com/en/docs/
Supports
- Gin's router and handler framework for Go HTTP services
- https://echo.labstack.com/docs/
Supports
- Echo's Go HTTP framework documentation
- https://gofiber.io/
Supports
- Fiber's Go web framework documentation
- https://gorm.io/docs/
Supports
- GORM models, CRUD operations, context, error handling, and database integration
- https://www.jetbrains.com/go/
Supports
- GoLand support for Go navigation, debugging, refactoring, testing, and deployment workflows
