Golang buildkit with shared low-level tools / build process required for Go projects of some quality.
See Turbo Bob for more details.
build-go-project.sh is available inside the container image.
Our typical projects declare the build-go-project.sh
call in the build command definition in
turbobob.json.
Cross compilation is done depending on ENV variables. E.g. to build for Linux/ARM
you should have
BUILD_LINUX_ARM=true
set. These are handled automatically if you use Turbo Bob.
- Go build environment
- Contains goimports which is like
gofmt
for your imports - it can sometimes even automatically add missing imports! - Contains gopls, a Go
language server. Works in a container without changes to one's host system!
- Working is somewhat tied to use with Turbo Bob (LSP working inside container needs a few tricks)
- Contains Gohack to make editing dependency modules easy
- Govulncheck reports known vulnerabilities that affect Go code.
- Fully static builds (so works even on Alpine linux which doesn't have standard libc)
- Cross compilation support:
- Linux-amd64
- Linux-arm
- Windows-amd64
- macOS-amd64
- Protobuf compiler included
- Deployer integration
- For packaging
deployerspec.zip
files
- For packaging
- doc2go for generating documentation (use case: private documentation). See why godoc isn't enough.
Standardized build process:
- Passes build version to your code
- Using gokit/app/dynversion
- Runs static analysis
- Uses golangci-lint
(does what
$ go vet
does + much more)
- Uses golangci-lint
(does what
- Runs your unit tests (
$ go test
)- With race detector enabled
- Fetches your dependencies using Go modules
- Automatically rejects Go code that is not
$ go fmt
'd - Runs any code generators you might have
- Runs
$ go generate ./...
- Runs
- Helper for packaging your binary as Lambda function
- Provides custom hooks between build steps if you have something special (though this might be a smell)