Libraries#

Go’s standard library is large and stable; reach for it before pulling in a dependency.

Standard Library#

  • fmt , formatted I/O

  • io / bufio , streams and buffered readers/writers

  • os , files, processes, environment

  • net/http , HTTP client and server

  • encoding/json , JSON marshalling

  • encoding/xml , XML

  • strings / bytes– text and byte-slice helpers

  • strconv , string ↔ number conversion

  • time , timestamps, durations, timers

  • context , cancellation and deadlines

  • sync / sync/atomic, mutexes, wait groups, atomics

  • log / log/slog, logging (slog is the structured logger)

  • errors , Is, As, Join

  • testing , the test framework

Module Tooling#

$ go mod init example.com/app
$ go get github.com/some/dep@v1.2.3
$ go mod tidy
$ go list -m all

Useful Third-Party#