Go ships with a large standard library, imported by paths without a domain, such as
"fmt" and "net/http". The full list and documentation are at
pkg.go.dev/std. The library is not part of the language
specification, except for unsafe,
which the compiler provides, and it is covered by the
Go 1 compatibility promise. This page
groups the packages briefly.
Package groups
| Group | Packages |
|---|---|
| Formatting and text | fmt, strings, strconv, unicode, unicode/utf8, unicode/utf16, bytes, text/template, text/tabwriter, text/scanner, regexp |
| Input and output | io, io/fs, bufio, os, os/exec, os/signal, os/user, path, path/filepath, log, log/slog, log/syslog |
| Generic helpers | slices, maps, cmp, iter, sort, container/heap, container/list, container/ring |
| Maths | math, math/big, math/bits, math/cmplx, math/rand, math/rand/v2 |
| Time and context | time, time/tzdata, context |
| Errors | errors |
| Concurrency | sync, sync/atomic |
| Data encoding | encoding/json, encoding/xml, encoding/csv, encoding/gob, encoding/binary, encoding/hex, encoding/base64, encoding/base32, encoding/pem, encoding/asn1 |
| Compression and archives | compress/gzip, compress/flate, compress/zlib, compress/bzip2, compress/lzw, archive/tar, archive/zip |
| Networking | net, net/netip, net/http, net/url, net/mail, net/smtp, net/textproto, net/rpc, html, html/template, mime |
| Cryptography and hashing | crypto/tls, crypto/x509, crypto/rand, crypto/aes, crypto/rsa, crypto/ed25519, crypto/sha256, crypto/sha3, crypto/mlkem, hash, hash/crc32, hash/fnv, hash/maphash |
| Images | image, image/png, image/jpeg, image/gif, image/color, image/draw |
| Databases | database/sql, database/sql/driver |
| Runtime and reflection | runtime, runtime/debug, runtime/pprof, runtime/trace, runtime/metrics, reflect, unsafe, structs, expvar, embed, flag |
| Parsing Go | go/ast, go/parser, go/scanner, go/token, go/printer, go/format, go/types, go/constant, go/build, go/build/constraint, go/doc, go/doc/comment, go/importer, go/version |
| Binaries and debug data | debug/elf, debug/macho, debug/pe, debug/dwarf, debug/gosym, debug/buildinfo |
| Testing | testing, testing/fstest, testing/iotest, testing/quick, testing/slogtest, testing/synctest, net/http/httptest |
| Operating system calls | syscall |
Packages under an internal path, and paths starting with vendor/ in
the standard library, are not for general use. See
Internal directories. For the packages
that read .go files, see the links on the
overview.
Other official packages
Packages with import paths starting golang.org/x/, such as
golang.org/x/net and golang.org/x/tools, are maintained by the Go
project outside the standard library, with looser compatibility requirements.