From b06df4867282ab100c4393ef94f21d0022b5e199 Mon Sep 17 00:00:00 2001
From: Pierre Smeyers <pierre.smeyers@gmail.com>
Date: Tue, 9 Aug 2022 09:30:40 +0200
Subject: [PATCH] fix(test): shellcheck

---
 templates/gitlab-ci-golang.yml | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/templates/gitlab-ci-golang.yml b/templates/gitlab-ci-golang.yml
index 57e170a..18886cf 100644
--- a/templates/gitlab-ci-golang.yml
+++ b/templates/gitlab-ci-golang.yml
@@ -140,9 +140,6 @@ stages:
     local junit_tests_report="reports/junit-tests-report.xml"
     local coverage_report_opts=-coverprofile=reports/coverage.out
 
-    # maybe produce Sonar test report (not failing)
-    sonar_tests_report || true
-
     set +e
     # shellcheck disable=SC2086
     go test $GO_TEST_FLAGS "$coverage_report_opts" $GO_TEST_PACKAGES > "$go_text_report"
@@ -157,11 +154,10 @@ stages:
 
     # produce JUnit report (for GitLab)
     install_go_junit_report
-    # shellcheck disable=SC2002
-    cat "$go_text_report" | "$GOBIN/go-junit-report" > "$junit_tests_report"
+    "$GOBIN/go-junit-report" < "$go_text_report" > "$junit_tests_report"
 
     # produce JSON report (for SonarQube)
-    cat "$go_text_report" | go tool test2json > "$go_json_report"
+    go tool test2json < "$go_text_report" > "$go_json_report"
 
     # maybe fail
     if [[ "$test_rc" != "0" ]]; then exit "$test_rc"; fi
-- 
GitLab