go

What's your take on the programming language Go?

I've just been told about a new programming language, Go, developed at Google by such notables as Ken Thompson and Rob Pike. Does anyone have any experience with it so far? What are your thoughts about how viable small- and large-scale applications could be developed with it? Relevant links (thanks to Lance Roberts; feel free to update ...

How to use C++ in Go?

In the new Go language, how do I call C++ code? In other words, how can I wrap my C++ classes and use them in Go? ...

Is it possible to do a call-cc in go-language? (go-lang.org)

Is it possible to do a call-cc (http://en.wikipedia.org/wiki/Call-with-current-continuation) in Google's new Language Go? (http://golang.org/) ...

Does Google's go-language address the problems in Paul's Graham's post 'Why Arc isn't Especially Object Oriented'?

Does Google's go-language (http://golang.org/) address the problems with languages addressed in Paul's Graham's post 'Why Arc isn't Especially Object Oriented'? (http://www.paulgraham.com/noop.html) ...

Can you detect how many threads a given number of goroutines will create?

I understand that Goroutines are multiplexed onto multiple OS threads so if one should block, such as while waiting for I/O, others continue to run, but is there any way to know ahead of time how many threads I would spawn if I were to create n goroutines? for example, if we call the funtion below below would we know how many (or the ma...

Go command line arguments

How do I nicely parse a list of program parameters and automate handling "--help" and/or "--version" (such as "program [-d value] [--abc] [FILE1]") in Go? ...

How can I compile a Go program?

I got Go to compile: 0 known bugs; 0 unexpected bugs and typed in the "hello world": package main import "fmt" func main() { fmt.Printf("Hello, 世界\n") } Then I tried to compile it, but it wouldn't go: $ 8c gotest2 gotest2:1 not a function gotest2:1 syntax error, last name: main This is going on on Ubuntu Linux on Pentium....

Emacs lisp mode for Go?

Is there a suitable Emacs lisp mode for Go? C mode doesn't work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn't require semicolons. ...

How do I get the command line arguments in Go without the "flags" package?

I'm trying to write a GNU-style command-line parser for Go, since the flags package doesn't handle all these yet: program -aAtGc --long-option-1 argument-to-1 --long-option-2 -- real-argument Obviously, I don't want to use the flags package, since I'm trying to replace it. Is there any other way to get to the command line? ...

Go network programming libs

Hi, I've decided to rewrite most of my distributed server programs in Go to replace the existing c# based ones. Can someone point me to a Go TCP libs or a Go general network programming lib. Thanks Edi: ... and how do i complile this code is visual stuido 2008? Thanks ...

Is there a comparison between Scala and Google 'Go' language (feature by feature)?

I wonder if someone can produce a comparison between Scala and Google 'Go' language (feature by feature, like concurrency models, collections, etc.)? ...

Can Go compiler be installed on Windows?

I've been looking on golang.org for a Windows compiler, but I can't seem to find it. I can only see Linux and OS X compilers. Does anyone know if Go programming can be done on Windows, or is it something that Google hasn't implemented yet? ...

Differences between Coroutines and GoTo?

I always read about the horrible thing that "goto" is. But, todaym reading about the google programming language "Go" http://golang.org/ and i see that it suports Coroutines (Goroutines). The question is: Coroutine == GoTo Or Coroutine != GoTo? Why? ...

Multiple initializers in a Go if statement

Just discovered Go, and am very curious so far. I know I'm just being lazy, but I want to know if it is possible to initialize multiple variables in an if statement. I know that the following is possible: if x := 5; x == 5 { fmt.Printf("Whee!\n") } I've tried the following: if x := 5, y := 38; x == 5 { fmt.Printf("Whee! %d\n"...

Go: "variable declared and not used" compilation error

I am learning Google's new language Go. I am just trying stuff out and I noticed that if you declare a variable and do not do anything with it the go compiler (8g in my case) fails to compile with this error: hello.go:9: error declared and not used. I was suprised at this since most language compilers just warn you about unused variables...

Why do I need a semicolon here?

Here is a test Go program: package main import fmt "fmt" func main () { ex := "moo cow\n"; fmt.Print (ex) } With the semicolon, it compiles. However, if the semicolon is removed, it doesn't: string.go:5: syntax error near fmt Any ideas? ...

Go examples and idioms

There's not a lot of Go code to learn the language from, and I'm sure I'm not the only one experimenting with it. So, if you found out something interesting about the language, please post an example here. I'm also looking for idiomatic ways to do things in Go, C/C++ style of thinking "ported" to Go, common pitfalls about the syntax,...

How do I use the .Read function in Go?

Trying to use Go's http package, I can't work out the syntax of .Read. The following marked by HERE is the only thing I have got to compile, although I tried several other things which were all rejected by the compiler. package main import "fmt"; import "http"; import "os"; func main () { kinopiko_flair := "http://stackoverflow.com...

Go language benchmarks?

I see the claims that Go is supposed to be almost comparable in speed to C, but are there any benchmarks available yet? ...

No symbol table in Go?

Google's new language "Go" says on its website: the language has been designed to be easy to analyze and can be parsed without a symbol table I'm certainly no expert on these matters, but I thought a symbol table was a basic construct common to all compilers for languages that use variables, and Go clearly uses variables. What am I...