It is known for the simplicity of its syntax and the efficiency of development that it enables by the inclusion of a large standard library supplying many needs for common projects.
[4] It is syntactically similar to C, but also has memory safety, garbage collection, structural typing,[7] and CSP-style concurrency.
[15] There are two major implementations: A third-party source-to-source compiler, GopherJS,[21] transpiles Go to JavaScript for front-end web development.
Go was designed at Google in 2007 to improve programming productivity in an era of multicore, networked machines and large codebases.
Although the design of most languages concentrates on innovations in syntax, semantics, or typing, Go is focused on the software development process itself.
But more significant was the early work that established fundamentals for packaging, dependencies, build, test, deployment, and other workaday tasks of the software development world, aspects that are not usually foremost in language design.
[33] In November 2016, the Go and Go Mono fonts were released by type designers Charles Bigelow and Kris Holmes specifically for use by the Go project.
Both fonts adhere to the WGL4 character set and were designed to be legible with a large x-height and distinct letterforms.
[37] The designers expressed an openness to generic programming and noted that built-in functions were in fact type-generic, but are treated as special cases; Pike called this a weakness that might be changed at some point.
[39] In August 2018, the Go principal contributors published draft designs for generic programming and error handling and asked users to submit feedback.
[42] In June 2020, a new draft design document[43] was published that would add the necessary syntax to Go for declaring generic functions and types.
A code translation tool, go2go, was provided to allow users to try the new syntax, along with a generics-enabled version of the online Go Playground.
As an alternative to C's three-statement for loop, Go's range expressions allow concise iteration over arrays, slices, strings, maps, and channels.
[74]: 270 The Go standard library uses interfaces to provide genericity in several places, including the input/output system that is based on the concepts of Reader and Writer.
[91] The go get command can retrieve packages stored in a remote repository[92] and developers are encouraged to develop packages inside a base path corresponding to a source repository (such as example.com/user_name/package_name) to reduce the likelihood of name collision with future additions to the standard library or other external libraries.
The go runtime also automatically schedules concurrent operations (goroutines) across multiple CPUs- this can achieve parallelism for a properly written program.
Although Go's concurrency features are not aimed primarily at parallel processing,[94] they can be used to program shared-memory multi-processor machines.
The study found that the non-expert tended to write divide-and-conquer algorithms with one go statement per recursion, while the expert wrote distribute-work-synchronize programs using one goroutine per processor core.
[105] Furthermore, Go's internal data structures like interface values, slice headers, hash tables, and string headers are not immune to data races, so type and memory safety can be violated in multithreaded programs that modify shared instances of those types without synchronization.
[109][110] Instead of language support, safe concurrent programming thus relies on conventions; for example, Chisnall recommends an idiom called "aliases xor mutable", meaning that passing a mutable value (or pointer) over a channel signals a transfer of ownership over the value to its receiver.
[96]: 155 The gc toolchain has an optional data race detector that can check for unsynchronized access to shared memory during runtime since version 1.1,[111] additionally a best-effort race detector is also included by default since version 1.6 of the gc runtime for access to the map data type.
[73] Exception handling was initially omitted in Go due to lack of a "design that gives value proportionate to the complexity".
[118] An exception-like panic/recover mechanism that avoids the usual try-catch control structure was proposed[119] and released in the March 30, 2010 snapshot.
[4] The Go authors put substantial effort into influencing the style of Go programs: The main Go distribution includes tools for building, testing, and analyzing code:
It also includes profiling and debugging support, fuzzing capabilities to detect bugs, runtime instrumentation (for example, to track garbage collection pauses), and a data race detector.
[135] Popular applications include: Caddy, a web server that automates the process of setting up HTTPS,[136] Docker, which provides a platform for containerization, aiming to ease the complexities of software development and deployment,[137] Kubernetes, which automates the deployment, scaling, and management of containerized applications,[138] CockroachDB, a distributed SQL database engineered for scalability and strong consistency,[139] and Hugo, a static site generator that prioritizes speed and flexibility, allowing developers to create websites efficiently.
[140] The interface system, and the deliberate omission of inheritance, were praised by Michele Simionato, who likened these characteristics to those of Standard ML, calling it "a shame that no popular language has followed [this] particular route".
All the hoops that the C++ programmer had to jump through in order to use a C-compatible language make no sense anymore -- they're just a waste of time and effort.
Go makes much more sense for the class of problems that C++ was originally intended to solve.A 2011 evaluation of the language and its gc implementation in comparison to C++ (GCC), Java and Scala by a Google engineer found: Go offers interesting language features, which also allow for a concise and standardized notation.
On October 12, 2010, the filed public issue ticket was closed by Google developer Russ Cox (@rsc) with the custom status "Unfortunate" accompanied by the following comment: "There are many computing products and services named Go.