Released · improving
Programming language · Since 2009
Go is a simple, statically typed language designed at Google, known for fast builds and goroutine-based concurrency in servers and cloud tooling.
Go (often called Golang) is an open-source programming language designed by engineers at Google and released publicly in 2009. It is statically typed and garbage-collected, yet keeps a small, deliberately simple syntax so that unfamiliar code stays easy to read.
Go shines where software has to handle many things at once and be easy to deploy: network servers, web APIs, command-line tools and cloud infrastructure. Goroutines and channels express concurrency, programs compile to a single self-contained binary, and widely used tools such as Docker and Kubernetes are written in Go.
To get started, install Go from go.dev and work through A Tour of Go, which runs right in your browser. Once the basics feel comfortable, read Effective Go to learn idiomatic style and use pkg.go.dev to browse the standard library and third-party packages.
A small set of keywords and a deliberately limited feature set make Go quick to learn and keep code consistent across teams.
Lightweight goroutines run work concurrently, and channels pass data between them, making concurrent programs comparatively straightforward.
Compilation is fast and produces one executable; changing two environment variables cross-compiles for another OS and architecture.
The standard library covers HTTP, JSON, cryptography and more, and the go command bundles formatting, testing and module management.
Download the installer or archive for Windows, macOS or Linux from go.dev/dl. A package manager such as winget, Homebrew or your distribution's packages works too.
Open a new terminal and check that the go command is on your PATH and reports its version.
go versionMake a project folder and initialize a module inside it; this creates the go.mod file that tracks dependencies.
go mod init example.com/helloEvery executable program starts in the main function of package main. It imports the standard fmt package and prints a line with Println; go run compiles the file and runs it immediately.
main.go
package main
import "fmt"
func main() {
fmt.Println("Hello, world!")
}
go run main.goSix chapters that take you from installation to the core ideas of Go.
Ask questions, share experience and trade opinions about Go.
No discussions yet. Start the first one.
0 comments
Sign in · Sign in to leave a comment.
Be the first to comment.