Skip to main content

Go

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/go-language

In short

Go is a compiled, statically typed language built for simplicity and fast builds, with garbage collection and built-in concurrency through goroutines.

What is the Go programming language?

Go is an open-source programming language created at Google by Robert Griesemer, Rob Pike, and Ken Thompson and released in 2009. It is often called "Golang" after its original website address, a name that is also easier to search for. Go was designed to keep large codebases easy to read and maintain, with a small set of keywords, one standard formatting tool (gofmt), and fast compilation to a single self-contained executable.

Go is statically typed, and short declarations like count := 5 let the compiler infer types. A type satisfies an interface simply by having the right methods, without declaring it, and generics have been available since Go 1.18. Memory is garbage-collected, but Go also has pointers (without pointer arithmetic) and value types, which give developers some control over how memory is laid out. Errors are ordinary values returned from functions rather than exceptions, so code typically checks if err != nil after each call that can fail.

Go's signature feature is built-in concurrency. A goroutine, started with the go keyword, is a lightweight function that runs at the same time as others, and channels let goroutines pass values to each other safely. It's like cooks in a kitchen handing finished dishes through a serving window instead of all grabbing from the same shelf. This makes Go popular for cloud infrastructure, network services, microservices, and command-line tools, including widely used container tools such as Docker and Kubernetes.

A goroutine is not the same as an operating system thread. The Go runtime schedules many goroutines onto a smaller pool of OS threads, so a goroutine starts with only a few kilobytes of stack and a program can run hundreds of thousands of them. OS threads are heavier to create and switch between, which is why Go programs can handle many concurrent connections with modest resources.

Key takeaways

  • Go compiles to a single native executable with no separate runtime to install.
  • It is statically typed and garbage-collected, with a deliberately small feature set.
  • Goroutines and channels make concurrent programs simpler to write.
  • Errors are returned as values instead of being thrown as exceptions.
  • It is popular for cloud services, networking tools, and command-line programs.

Example

Goroutines sending results over a channelgo
package main

import "fmt"

func main() {
    results := make(chan string)
    for i := 1; i <= 3; i++ {
        // Each goroutine runs concurrently and sends a message
        go func(id int) { results <- fmt.Sprintf("worker %d done", id) }(i)
    }
    for i := 0; i < 3; i++ {
        fmt.Println(<-results) // Receive one message from the channel
    }
}

Readers ask

Why is Go also called Golang?

The language's official name is Go, but its original website was golang.org, and "golang" is easier to search for than the common word "go". Both names refer to the same language.

Does Go have classes?

No. Go uses structs to group data and lets you attach methods to any type you define, and it relies on interfaces and composition instead of class inheritance.

Is Go garbage-collected?

Yes. Go has a concurrent garbage collector designed for short pauses, so developers don't free memory manually, though they can still use pointers and value types to reduce allocations.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings