Choose TypeScript, Go, Rust or C++ and find syntax, everyday APIs, standard libraries and tools in one place.
Scope and conventions
TypeScript/Node, Go 1.23+, Rust 2024 and C++23: from a first CLI to files, JSON, HTTP, concurrency and testing. Complete programs are labeled; other examples identify their surrounding code/imports. Optional libraries and version requirements are named in each entry.
Files belong to a package. import makes another package available through a qualified name. Uppercase names are exported. go.mod identifies the module containing packages.
Capitalized package-level identifiers and field/method names are exported. Lowercase names are package-private, not private to one file. Files in the same package share the package namespace.
Fragment
Fragment: imports and type/function declarations at file scope; usage statements inside a function.
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
package placesconst DefaultName = "north"const internalName = "west"type Place struct { Name string note string}
Ordinary files in one directory normally share a package and can use each other’s package-level names directly. Import paths identify packages, not individual .go files. This main package uses both files together.
Fragment
Two complete files in one initialized module directory; run with go run .
go.mod names the module and records dependency/language requirements. go.sum records dependency checksums; it is not a lockfile that freezes every selected version in the same way as npm’s lockfile.
Fragment
go.mod example; not Go source. Go 1.23 is sufficient for the reference’s Go examples.
Standard-library imports need no go get. go get manages module dependencies; go mod tidy reconciles requirements with the packages used by the module. Module paths and package names need not be identical.
Fragment
Shell command in a Go module; third-party requirements follow that project’s chosen module paths/versions.
main.go
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
# Standard library: import "strings"# Reconcile go.mod/go.sum with imports:go mod tidy