Skip to main content

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.

Filter by
Sorted by
Tagged with
91 votes
1 answer
25k views

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....
Logan's user avatar
  • 1,013
77 votes
3 answers
70k views

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's user avatar
  • 3,237
63 votes
10 answers
26k views

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 ...
TheEnvironmentalist's user avatar
58 votes
12 answers
7k views

Who here is learning Go? Are other companies looking at using it? Is it likely to become widely used?
interstar's user avatar
  • 1,459
36 votes
8 answers
7k views

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 ...
user39019's user avatar
  • 615
35 votes
4 answers
6k views

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 ...
David's user avatar
  • 4,449
22 votes
5 answers
11k views

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 ...
jim's user avatar
  • 483
19 votes
1 answer
6k views

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 ...
nish1013's user avatar
  • 291
18 votes
3 answers
2k views

I've been watching an interview with Herb Sutter on Channel9 and he mentioned at the end of the video that left to right language syntax would be on the top on his whishlist for a future C++ standard(...
celavek's user avatar
  • 373
16 votes
1 answer
9k views

The Golang "netchan" package seems to have been discontinued. That makes me think that the concept of "networked channels" were not a good practice after all. (Why wouldn't them just "let it be" ...
Sebastián Grignoli's user avatar
14 votes
5 answers
4k views

I've been thinking a lot about language design and what elements would be necessary for an "ideal" programming language, and studying Google's Go has led me to question a lot of otherwise common ...
tylerl's user avatar
  • 4,880
11 votes
3 answers
2k views

I am wondering if there is a difference between Haskell's type classes and Go's interfaces. Both define types based on functions, in that way, that a value matches a type, if a function required by ...
ceving's user avatar
  • 401
10 votes
2 answers
4k views

I've read that Go doesn't actually have true type inference in the sense that functional languages such as ML or Haskell have, but I haven't been able to find a simple to understand comparison of the ...
a3onstorm's user avatar
  • 211
9 votes
3 answers
617 views

I was playing around with Go, and found this particular interesting code for the abs function in the math package: http://golang.org/src/pkg/math/abs.go 14 func abs(x float64) float64 { 15 ...
user84386's user avatar
  • 107
9 votes
1 answer
7k views

I'm trying to build a project using the clean architecture, as described here. I found a great article on how to do this in Go. The example is a very simple one, and the author puts their code into ...
bigblind's user avatar
  • 1,425
6 votes
2 answers
16k views

As the title says, is accessing public struct fields more idiomatic in Go than getters and setters? Wouldn't that lead to violation of data encapsulation, also public fields in other OO languages like ...
Fish's user avatar
  • 406
6 votes
2 answers
317 views

If data is simple and objects are complex, I'm curious if there are any existing statically typed languages that would be able to augment(?) a map type into a type with guaranteed fields. I realize ...
case nelson's user avatar
6 votes
1 answer
796 views

As an exercise, I'm implementing HashLife in Go. In brief, HashLife works by memoizing nodes in a quadtree so that once a given node's value in the future has been calculated, it can just be looked ...
Moishe's user avatar
  • 163
5 votes
2 answers
3k views

Go and D provide garbage collection, and yet they claim to be system programming languages. What degree of low-level programming can be achieved with languages having garbage collection? For low-...
samual's user avatar
  • 213
5 votes
2 answers
3k views

Background: pthreads follow pre-emptive scheduling, whereas C++ fibers follow cooperative scheduling. With Pthreads: the current execution path may be interrupted or preempted at any time This ...
overexchange's user avatar
  • 2,315
5 votes
1 answer
2k views

Since the Go lang is getting popular, I started to play with it. I do derive from Java language so when I saw the Go syntax it has been a bit strange to me. sample code from go lang project site: ...
DevDio's user avatar
  • 257
5 votes
1 answer
315 views

I'm writing a little GUI system for my game in Go. So far my structure is kind of like this: type Component interface { Update() Render(ctx) Translate() GetComponent() []Component ...
flooblebit's user avatar
4 votes
5 answers
2k views

I was reading about composition over inheritance and came across a question about solving the Circle-Ellipse Problem in Object-Oriented Programming. This kind of problem is often used as an example of ...
drkvogel's user avatar
  • 157
4 votes
2 answers
363 views

I have a class (as a protobuf) OrderChange, that represents when an order (imagine Amazon.com) changes: message OrderChange { Order old_order = 1; Order new_order = 2; } message Order { ...
onepiece's user avatar
  • 169
4 votes
2 answers
3k views

Since I started programming, I've always been taught to leave a trailing blank line at the end of my files, the reason usually being something relating to how it makes concatenated files easier to ...
Jules's user avatar
  • 361