File: check-go-mod-version.sh

package info (click to toggle)
golang-github-prometheus-common 0.46.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,224 kB
  • sloc: makefile: 23; sh: 7
file content (12 lines) | stat: -rwxr-xr-x 295 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash

readarray -t mod_files < <(find . -type f -name go.mod)

echo "Checking files ${mod_files[@]}"

matches=$(awk '$1 == "go" {print $2}' "${mod_files[@]}" | sort -u | wc -l)

if [[ "${matches}" -ne 1 ]]; then
  echo 'Not all go.mod files have matching go versions'
  exit 1
fi