Using DockerSlim ( http://dockersl.im ) is another option if you don’t want to deal with these details by hand. In some cases it’s almost impossible to build usable static Go apps (when you use Cgo). CockroachDB is a good example :-)
Thanks for the comment! That part should be refactored to make it less confusing.
Short answer: no ☺
It just says that you don’t have to put your main application files into separate directories, but if you do that you’ll have multiple main() function…
The referenced GitHub project is intentionally basic to make it generic and less opinionated enough. There’ll be an additional 'template' GitHub project that will have much more and it’ll be a bit more prescriptive in terms of what’s going into those directories.
It’s a nice option when the Go app is simple, but what if it’s not and the app has other dependencies and what if you do need CGO… For those cases you can use DockerSlim ( http://dockersl.im ). You can use any base image you want and it’ll generate the smallest possible image.