Skip to content

Commit

Permalink
go/lint: look for nilaway on runners
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Nov 17, 2023
1 parent dbf81cf commit b92305a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions go/lint-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,30 @@ then
# Install nilaway
go install go.uber.org/nilaway/cmd/nilaway@latest

# Find the linter
# Find nilaway on PATH
bin=""
if which -s nilaway > /dev/null;
then
bin=$(which nilaway 2>&1 | head -n1)
fi
# Public Github runners path
actions_path="/home/runner/go/bin/nilaway"
if [[ -f "$actions_path" ]];
then
bin="$actions_path"
fi
# Moov hosted runner paths
actions_path="/home/actions/bin/nilaway"
if [[ -f "$actions_path" ]];
then
bin="$actions_path"
fi

# Run nilaway
"$bin" -test=false ./...
if [[ "$bin" != "" ]];
then
"$bin" -test=false ./...
fi
fi

# golangci-lint
Expand Down

0 comments on commit b92305a

Please sign in to comment.