File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 4949 exit 1
5050fi
5151
52+ GOMOD_ERRORS=0
53+
54+ # Check go.mod files for correct dependency versions
55+ while read -r mod_file; do
56+ # Look for go-redis packages in require statements
57+ while read -r pkg version; do
58+ if [ " $version " != " ${TAG} " ]; then
59+ printf " Error: %s has incorrect version for package %s: %s (expected %s)\n" " $mod_file " " $pkg " " $version " " ${TAG} "
60+ GOMOD_ERRORS=$(( GOMOD_ERRORS + 1 ))
61+ fi
62+ done < <( awk ' /^require|^require \(/{p=1;next} /^\)/{p=0} p{if($1 ~ /^github\.com\/redis\/go-redis/){print $1, $2}}' " $mod_file " )
63+ done < <( find . -type f -name ' go.mod' )
64+
65+ # Exit if there are gomod errors
66+ if [ $GOMOD_ERRORS -gt 0 ]; then
67+ exit 1
68+ fi
69+
70+
5271PACKAGE_DIRS=$( find . -mindepth 2 -type f -name ' go.mod' -exec dirname {} \; \
5372 | grep -E -v " example|internal" \
5473 | sed ' s/^\.\///' \
You can’t perform that action at this time.
0 commit comments