Usually at work and at home we use different Git name/email pairs, or even per project. Pushing with correct email guarantees that your commits will be authored with a correct user identity.
This post shows how to work with DATETIME/DATE columns in DB and use Go standard time.Time avoiding manual string parsing. This article contains examples using 2 packages: database/sql and github.
A common workaround for building Golang application in Docker is to have 2 Dockerfiles - one to perform a build and another to ship the results of the first build without tooling in the first image.
I am working with git every single day, from different machines and accounts. And all these hosts have the same global git configuration. I sync it using tiny bash script.
The design of Go’s runtime assumes that the programmer is responsible for detecting when to terminate a goroutine and when to terminate the program. Normally, a program can be terminated in a normal way by calling os.
Go 1.8 gives us a new tool for creating shared libraries, called plugins! This new plugin buildmode is currently only supported on Linux. But what if we build plugin with data in binary format inside?
What is go-bindata and why do we need it? go-bindata converts any text or binary file into Go source code, which is useful for embedding data into Go programs.
As a Golang developer I have to clone a lot of packages/tools/etc into $GOPATH/src/github.com. Sometimes I do go get, sometimes it’s necessary to do a combination of mkdir + git clone.
Usually integration tests take long time, because they’re doing real requests to real system. And it’s not necessary to run them every time we type go test.
In some of my projects we have code that needs to run external executables, and it’s very difficult to test them, especially when your function is based on some kind of stdout parcing.