We have a golang project that can successfully run unit tests locally.
But we run the same unit tests on Travis CI, we got follow error:
fatal error: runtime: out of memory
It seems like your linter is causing exceeding memory usage. There’s a few things I recommend.
Look into golangci-lint, this is a fast Go linter runner. It runs linters in parallel, uses caching, supports yaml config.
You want to set analysis pass results to nil early to garbage collect them sooner. So in theory adding this to your .travis.yml could be extremely useful: