Top "Go" questions

Go is an open-source programming language.

How to format current time using a yyyyMMddHHmmss format?

I'm trying to format the current time using this format yyyyMMddHHmmss. t := time.Now() fmt.Println(t.Format("yyyyMMddHHmmss")) That …

time go format timestamp
Go install fails with error: no install location for directory xxx outside GOPATH

~/src/go-statsd-client> echo $GOPATH /Users/me/gopath ~/src/go-statsd-client> echo $GOROOT /usr/local/Cellar/go/1.1.1\ ~/src/go-statsd-client> …

macos go
Init array of structs in Go

I'm newbie in Go. This issue is driving me nuts. How do you init array of structs in Go? type …

arrays struct go
How to convert from []byte to int in Go Programming

I need to create a client-server example over TCP. In the client side I read 2 numbers and I send them …

tcp client-server byte type-conversion go
Import cycle not allowed

I have a problem with import cycle not allowed It appears, when I am trying to test my controller. As …

go
How to index characters in a Golang string?

How to get an "E" output rather than 69? package main import "fmt" func main() { fmt.Print("HELLO"[1]) } Does Golang have …

string go character
Go doing a GET request and building the Querystring

I am pretty new to Go and don't quite understand everything as yet. In many of the modern languages Node.…

http go
How do you print in a Go test using the "testing" package?

I'm running a test in Go with a statement to print something (i.e. for debugging of tests) but it's …

testing go
Cross compile Go on OSX?

I am trying to cross-compile a go app on OSX to build binaries for windows and linux. I have read …

go compilation cross-compiling
Golang read request body

I am writing my own logginMiddleware. Basically, I need to log body of the request and the response. The problem …

http go server