Skip to content

Commit

Permalink
gosec.sh: avoid code dup
Browse files Browse the repository at this point in the history
Code duplication is evil in any language; It's even more evil in bash,
because it's bash.

Signed-off-by: Dan Kenigsberg <[email protected]>
  • Loading branch information
dankenigsberg committed Jan 14, 2021
1 parent b20eb85 commit 548e099
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hack/gosec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ mkdir -p $ARTIFACTS
echo "Run go sec in pkg"
cd $KUBEVIRT_DIR/pkg

if [ -z $GOSEC ]; then
gosec -sort -quiet -out=${ARTIFACTS}/junit-gosec.xml -exclude-dir=testutils -fmt=junit-xml ./...
else
ARGS="-sort -quiet -out=${ARTIFACTS}/junit-gosec.xml -exclude-dir=testutils -fmt=junit-xml ./..."
if [ ! -z $GOSEC ]; then
echo "Running subset"
echo $GOSEC
gosec -include=$GOSEC -sort -quiet -out=${ARTIFACTS}/junit-gosec.xml -exclude-dir=testutils -fmt=junit-xml ./...
ARGS="-include=$GOSEC $ARGS"
fi
gosec $ARGS

0 comments on commit 548e099

Please sign in to comment.