Go is a statically typed, compiled high-level programming language designed at Google[12] by Robert Griesemer, Rob Pike, and Ken Thompson.[4] It is syntactically similar to C, but also has memory safety, garbage collection, structural typing,[7] and CSP-style concurrency.[13] It is often referred to as Golang because of its former domain name, golang.org, but its proper name is Go.[14]

Go was designed at Google in 2007 to improve programming productivity in an era of multicore, networked machines and large codebases.[21] The designers wanted to address criticisms of other languages in use at Google, but keep their useful characteristics:[22]


Golang Download Ftp


Download File 🔥 https://fancli.com/2yGanc 🔥



Go was publicly announced in November 2009,[27] and version 1.0 was released in March 2012.[28][29] Go is widely used in production at Google[30] and in many other organizations and open-source projects.

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. Go is a humanist sans-serif resembling Lucida Grande, and Go Mono is monospaced. Both fonts adhere to the WGL4 character set and were designed to be legible with a large x-height and distinct letterforms. Both Go and Go Mono adhere to the DIN 1450 standard by having a slashed zero, lowercase l with a tail, and an uppercase I with serifs.[32][33]

In April 2018, the original logo was redesigned by brand designer Adam Smith. The new logo is a modern, stylized GO slanting right with trailing streamlines. (The Gopher mascot remained the same.[34])

The lack of support for generic programming in initial versions of Go drew considerable criticism.[35] 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.[36] The Google team built at least one compiler for an experimental Go dialect with generics, but did not release it.[37]

In August 2018, the Go principal contributors published draft designs for generic programming and error handling and asked users to submit feedback.[38][39] However, the error handling proposal was eventually abandoned.[40]

In June 2020, a new draft design document[41] was published that would add the necessary syntax to Go for declaring generic functions and types. A code translation tool, .mw-parser-output .monospaced{font-family:monospace,monospace}go2go, was provided to allow users to try the new syntax, along with a generics-enabled version of the online Go Playground.[42]

Go does not follow SemVer; rather, each major Go release is supported until there are two newer minor releases. Unlike most software, Go calls the second number in a version the major, i.e., in 1.x x is the major version. [46] This is because Go plans to never reach 2.0, given that compatibility is one of language's major selling points.[47]

Methods may return multiple values, and returning a result, err pair is the conventional way a method indicates an error to its caller in Go.[d] Go adds literal syntaxes for initializing struct parameters by name and for initializing maps and slices. As an alternative to C's three-statement for loop, Go's range expressions allow concise iteration over arrays, slices, strings, maps, and channels.[56]

Go has a number of built-in types, including numeric ones (byte, int64, float32, etc.), booleans, and byte strings (string). Strings are immutable; built-in operators and keywords (rather than functions) provide concatenation, comparison, and UTF-8 encoding/decoding.[57] Record types can be defined with the struct keyword.[58]

For each type T and each non-negative integer constant n, there is an array type denoted [n]T; arrays of differing lengths are thus of different types. Dynamic arrays are available as "slices", denoted []T for some type T. These have a length and a capacity specifying when new memory needs to be allocated to expand the array. Several slices may share their underlying memory.[36][59][60]

Pointers are available for all types, and the pointer-to-T type is denoted *T. Address-taking and indirection use the & and * operators, as in C, or happen implicitly through the method call or attribute access syntax.[61][62] There is no pointer arithmetic,[e] except via the special unsafe.Pointer type in the standard library.[63]

Aside from its support for interfaces, Go's type system is nominal: the type keyword can be used to define a new named type, which is distinct from other named types that have the same layout (in the case of a struct, the same members in the same order). Some conversions between types (e.g., between the various integer types) are pre-defined and adding a new type may define additional conversions, but conversions between named types must always be invoked explicitly.[65] For example, the type keyword can be used to define a type for IPv4 addresses, based on 32-bit unsigned integers as follows:

Function types are indicated by the func keyword; they take zero or more parameters and return zero or more values, all of which are typed. The parameter and return values determine a function type; thus, func(string, int32) (int, error) is the type of functions that take a string and a 32-bit signed integer, and return a signed integer (of default width) and a value of the built-in interface type error.[68]

The definition of an interface type lists required methods by name and type. Any object of type T for which functions exist matching all the required methods of interface type I is an object of type I as well. The definition of type T need not (and cannot) identify type I. For example, if Shape, Square and Circle are defined as

Besides calling methods via interfaces, Go allows converting interface values to other types with a run-time type check. The language constructs to do so are the type assertion,[76] which checks against a single potential type:

The interface{} type can be used to model structured data of any arbitrary schema in Go, such as JSON or YAML data, by representing it as a map[string]interface{} (map of string to empty interface). This recursively describes data in the form of a dictionary with string keys and values of any type.[79]

Interface values are implemented using pointer to data and a second pointer to run-time type information.[80] Like some other types implemented using pointers in Go, interface values are nil if uninitialized.[81]

Functions and types now have the ability to be generic using type parameters. These type parameters are specified within square brackets, right after the function or type name.[83] The compiler transforms the generic function or type into non-generic by substituting type arguments for the type parameters provided, either explicitly by the user or type inference by the compiler.[84] This transformation process is referred to as type instantiation.[85]

In Go's package system, each package has a path (e.g., "compress/bzip2" or "golang.org/x/net/html") and a name (e.g., bzip2 or html). References to other packages' definitions must always be prefixed with the other package's name, and only the capitalized names from other packages are accessible: io.Reader is public but bzip2.reader is not.[88] The go get command can retrieve packages stored in a remote repository[89] 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.[90]

The Go language has built-in facilities, as well as library support, for writing concurrent programs. Concurrency refers not only to CPU parallelism, but also to asynchrony: letting slow operations like a database or network read run while the program does other work, as is common in event-based servers.[91]

From these tools one can build concurrent constructs like worker pools, pipelines (in which, say, a file is decompressed and parsed as it downloads), background calls with timeout, "fan-out" parallel calls to a set of services, and others.[97] Channels have also found uses further from the usual notion of interprocess communication, like serving as a concurrency-safe list of recycled buffers,[98] implementing coroutines (which helped inspire the name goroutine),[99] and implementing iterators.[100]

Concurrency-related structural conventions of Go (channels and alternative channel inputs) are derived from Tony Hoare's communicating sequential processes model. Unlike previous concurrent programming languages such as Occam or Limbo (a language on which Go co-designer Rob Pike worked),[101] Go does not provide any built-in notion of safe or verifiable concurrency.[102] While the communicating-processes model is favored in Go, it is not the only one: all goroutines in a program share a single address space. This means that mutable objects and pointers can be shared between goroutines; see Lack of data race safety, below.

Although Go's concurrency features are not aimed primarily at parallel processing,[91] they can be used to program shared-memory multi-processor machines. Various studies have been done into the effectiveness of this approach.[103] One of these studies compared the size (in lines of code) and speed of programs written by a seasoned programmer not familiar with the language and corrections to these programs by a Go expert (from Google's development team), doing the same for Chapel, Cilk and Intel TBB. 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. The expert's programs were usually faster, but also longer.[104]

Go deliberately omits certain features common in other languages, including (implementation) inheritance, assertions,[f] pointer arithmetic,[e] implicit type conversions, untagged unions,[g] and tagged unions.[h] The designers added only those facilities that all three agreed on.[114] 152ee80cbc

how to download uco bank statement online

english news app download

download multiplayer