Top "Go" questions

Go is an open-source programming language.

Can functions be passed as parameters?

In Java I can do something like derp(new Runnable { public void run () { /* run this sometime later */ } }) and "run" the …

function go
How to initialize a nested struct?

I cannot figure out how to initialize a nested struct. Find an example here: http://play.golang.org/p/NL6…

go
How to convert interface{} to string?

I'm using docopt to parse command-line arguments. This works, and it results in a map, such as map[<host&…

go
cannot download, $GOPATH not set

I want to install json2csv using go get github.com/jehiah/json2csv but I receive this error: package …

macos installation go
How to compile Go program consisting of multiple files?

I have a small program that consists of three files, all belonging to the same package (main), but when I …

go build compiler-errors
How to access global variables

How do I access a variable that was declared/init in my main.go in a different .go package/file? …

variables go global main
How to do date/time comparison

Is there any options in doing date comparison in Go? I have to sort data based on date and time …

datetime go datetime-comparison
Convert an integer to a float number

How do I convert an integer value to float64 type? I tried float(integer_value) But this does not work. …

go
Correct way of getting Client's IP Addresses from http.Request

What's the correct way to get all client's IP Addresses from http.Request? In PHP there are a lot of …

http go ip
How to check for an empty struct?

I define a struct ... type Session struct { playerId string beehive string timestamp time.Time } Sometimes I assign an empty session …

struct go