Skip to content

Commit

Permalink
Revert "go/lint: rework coverage analysis"
Browse files Browse the repository at this point in the history
This reverts commit 20406fe.
  • Loading branch information
adamdecaf committed Feb 7, 2024
1 parent 20406fe commit c483147
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/lint-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ if [[ "$OS_NAME" != "windows" ]]; then
-test.memprofile="$dir"/mem.out \
-count 1 $GOTEST_FLAGS

coverage=$(go tool cover -func="$dir"/coverage.txt | cut -w -f3 | cut -d'%' -f1 | grep -v '^0.0$' | sort -u | awk '{x+=$0}END{print x/NR}')
coverage=$(go tool cover -func="$dir"/coverage.txt | grep total | grep -Eo '[0-9]+\.[0-9]+')
if [[ "$coverage" > "0.0" ]];
then
coveredStatements=$(echo "$coveredStatements" + "$coverage" | bc)
Expand All @@ -408,7 +408,7 @@ fi
if [[ "$COVER_THRESHOLD" != "" ]]; then
if [[ -f coverage.txt && "$PROFILE_GOTEST" != "yes" ]];
then
coveredStatements=$(go tool cover -func=coverage.txt | cut -w -f3 | cut -d'%' -f1 | grep -v '^0.0$' | sort -u | awk '{x+=$0}END{print x/NR}')
coveredStatements=$(go tool cover -func=coverage.txt | grep -E '^total:' | grep -Eo '[0-9]+\.[0-9]+')
maximumCoverage=100
fi

Expand Down

0 comments on commit c483147

Please sign in to comment.