Questions tagged [go]

Go, also called golang, is an open source programming language initially developed at Google. It is a statically-typed language with syntax loosely derived from that of C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.

Go is a general-purpose language designed with systems programming in mind. While created by Google employees, including Ken Thompson, Rob Pike and Robert Griesemer, Go is an open source project with a large contributor base outside of Google. It is aimed to be efficient both for development and execution with a focus on fast compilation and increasing the maintainability of large projects. Go was originally targeted at systems programming tasks such as building server/web applications, high throughput middle-ware and databases. Go has a growing ecosystem of libraries allowing it to be used for a wide variety of tasks such as developing end-user daemons, CLIs and desktop applications.

Go is expressive, concise, clean, and efficient. Its first class concurrency mechanisms make it easy to write programs that get the most out of multi-core and networked machines, while its structural type system enables flexible and modular program construction. Go compiles quickly to memory safe machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that develops like a dynamically typed, interpreted language, but performs like native code.

There are now several Go programs deployed in production inside and outside Google, as well as being supported directly by Google App Engine.

On March 28, 2012, The Go team released version 1.0, along with binary distributions.

The latest version is 1.4 released on December 10, 2014.

Go Tutorials

Go Books

Free Go Books

Go projects

Go Reference Documentation

Go official mailing lists

Go IRC channel

Online Go Compilers

Videos

FAQ

137 questions
85
votes
1 answer

How are Rust Traits different from Go Interfaces?

I am relatively familiar with Go, having written a number of small programs in it. Rust, of course, I am less familiar with but keeping an eye on. Having recently read http://yager.io/programming/go.html, I thought I'd personally examine the two…
Logan
  • 953
  • 1
  • 7
  • 7
81
votes
2 answers

Why is there a "new" in Go?

I'm still puzzled as why we have new in Go. When you want to instantiate a struct, you do t := Thing{} and you can get a pointer to a new instance by doing t := &Thing{} But there's also this possibility : t := new(Thing) This last one seems a…
Denys Séguret
  • 1,424
  • 1
  • 10
  • 14
76
votes
3 answers

Sets Data Structure in Golang

I really like google golang but could some one explain what the rationale is for the implementors having left out a basic data structure such as sets from the standard library?
cobie
  • 3,237
  • 5
  • 23
  • 21
62
votes
9 answers

Why do "checked exceptions", i.e., "value-or-error return values", work well in Rust and Go but not in Java?

Java has "checked exceptions", which force the caller of the method to either handle an exception or to rethrow it, e.g. // requires ParseException to be handled or rethrown int i = NumberFormat.getIntegerInstance().parse("42").intValue(); Other,…
Heinzi
  • 9,646
  • 3
  • 46
  • 59
62
votes
1 answer

Are go-langs goroutine pools just green threads?

The commentator here offers the following criticism of green threads: I was initially sold on the N:M model as a means of having event driven programming without the callback hell. You can write code that looks like pain old procedural code but…
hawkeye
  • 4,819
  • 3
  • 24
  • 35
61
votes
10 answers

Does it ever make sense to use more concurrent processes than processor cores?

I've got some process in Go. Here's an example counting lines in text, though the question is meant to be far more general than this particular example: func lineCount(s string) int { count := 0 for _, c := range s { if c == '\n' { …
TheEnvironmentalist
  • 1,159
  • 1
  • 8
  • 14
58
votes
12 answers

What are the chances of Google's Go becoming a mainstream language?

Who here is learning Go? Are other companies looking at using it? Is it likely to become widely used?
interstar
  • 1,449
  • 10
  • 15
39
votes
4 answers

How fast can Go go?

Go is one of the few languages that are supposed to run 'close to the metal', i. e. it's compiled, statically typed and executes code natively, without a VM. This should give it a speed advantage over Java, C# and the like. It seems, however, that…
Greg Slodkowicz
  • 971
  • 2
  • 9
  • 11
36
votes
3 answers

Is having source code for a Go project outside GOPATH a bad idea

I am working on a new project using Go, and we are all new to Go. We are following the standard go directory structure, and having all code under $GOPATH/src/github.com/companyname/projectname which is also the root of a git repository The…
Pete
  • 8,916
  • 3
  • 41
  • 53
35
votes
4 answers

How much is Google investing in the Go language?

I have read quite a bit about the Go language, and it seems promising. The last important bit of information I am missing before I decide on spending more effort on the language is: How much money/man power does Google or other companies invest in…
David
  • 4,449
  • 6
  • 35
  • 48
34
votes
8 answers

When would you need "hundreds of thousands" of threads?

Erlang, Go, and Rust all claim in one way or another that they support concurrent programming with cheap "threads"/coroutines. The Go FAQ states: It is practical to create hundreds of thousands of goroutines in the same address space. The Rust…
user39019
  • 595
  • 4
  • 6
24
votes
1 answer

How does Go improve productivity with "implicit" interfaces, and how does that compare with C#'s notion of Extension Methods?

In the Go Language Tutorial, they explain how interfaces work: Go does not have classes. However, you can define methods on struct types. The method receiver appears in its own argument list between the func keyword and the method name. type…
Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
22
votes
1 answer

Could Hindley-Milner inference work for the Go language?

I've read that Hindley-Milner does not work with type systems that have subclasses, and there are other type system features that also do not work well with it. Go currently has only very limited type inference in the := operator. But Go does not…
JanKanis
  • 421
  • 4
  • 7
21
votes
5 answers

Is a common library a good idea?

I've always thought that a "common library" was a good idea. By that I mean a library that contains the common functionality that is often needed by a few different applications. It results in less code duplication/redundancy. I recently read an…
jim
  • 473
  • 3
  • 8
19
votes
1 answer

Erlang and Go concurrent programming, objective differences between CSP and Actors?

I was looking into concurrent programming in Erlang and Go programming languages. As per my finding they are used Actor model and CSP respectively. But still I am confused with what are the objective differences between CSP and Actors? is it just…
nish1013
  • 291
  • 2
  • 5
1
2 3
9 10