File: check-tidy.sh

package info (click to toggle)
golang-github-confluentinc-bincover 0.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: makefile: 42; sh: 33
file content (22 lines) | stat: -rwxr-xr-x 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

set -e

: "${GO:=go}"

goversion=$($GO version)

$GO mod tidy

rc=0
diff=$(git diff --exit-code -- go.mod go.sum) || rc=$?

if [ $rc -ne 0 ]; then
    echo "Found some differences when running 'go mod tidy'"
    echo "**********"
    echo "$diff"
    echo "**********"
    echo "Please ensure you are using the correct version of go ($goversion), run 'go mod tidy', and commit the changes"
fi

exit $rc