Skip to content

Commit

Permalink
Tune memory footprint of golangci-lint
Browse files Browse the repository at this point in the history
Also, limit concurrency to 4 processes.
  • Loading branch information
corneliusweig committed Sep 26, 2019
1 parent 66d2b9c commit 7bf9120
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hack/linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ VERBOSE=""
if [[ "${TRAVIS}" == "true" ]]; then
# Use less memory on Travis
# See https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
export GOGC=10
export GOGC=${GOLINT_GOGC:-8}
VERBOSE="-v --print-resources-usage"
fi

golangci-lint run ${VERBOSE} -c ${DIR}/golangci.yml \
# Limit number of default jobs, to avoid the CI builds running out of memory
GOLINT_JOBS=${GOLINT_JOBS:-4}

golangci-lint run ${VERBOSE} -c ${DIR}/golangci.yml --concurrency $GOLINT_JOBS \
| awk '/out of memory/ || /Deadline exceeded/ {failed = 1}; {print}; END {exit failed}'

0 comments on commit 7bf9120

Please sign in to comment.