diff --git a/templates/gitlab-ci-golang.yml b/templates/gitlab-ci-golang.yml index 9edc5fb49c3522258a476e5a14d922b8c0a076e1..4fa21a1b334cfcca210ca2d6787cd05682c006c7 100644 --- a/templates/gitlab-ci-golang.yml +++ b/templates/gitlab-ci-golang.yml @@ -719,7 +719,14 @@ go-ci-lint: script: - mkdir -p -m 777 reports # produce all reports at once - - golangci-lint run --out-format "colored-line-number:stdout,code-climate:reports/go-ci-lint.codeclimate.json,checkstyle:reports/go-ci-lint.checkstyle.xml" $GO_CI_LINT_ARGS + - | + glc_ver_major=$(golangci-lint version | cut -d' ' -f4 | cut -d'.' -f1) + if [[ "$glc_major_ver" == "1" ]] + then + golangci-lint run --out-format "colored-line-number:stdout,code-climate:reports/go-ci-lint.codeclimate.json,checkstyle:reports/go-ci-lint.checkstyle.xml" $GO_CI_LINT_ARGS + else + golangci-lint run --output.text.path stdout --output.code-climate.path reports/go-ci-lint.codeclimate.json --output.checkstyle.path reports/go-ci-lint.checkstyle.xml $GO_CI_LINT_ARGS + fi artifacts: name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" expire_in: 1 day