diff --git a/scripts/test.sh b/scripts/test.sh index 5fa115487..9bc5a3f51 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -535,7 +535,7 @@ function dump_deps_of_module() { if ! module=$(run go list -m); then return 255 fi - run go list -f "{{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},${module}{{end}}{{end}}" -m all + run go mod edit -json | jq -r '.Require[] | .Path+","+.Version+","+if .Indirect then " (indirect)" else "" end+",'"${module}"'"' } # Checks whether dependencies are consistent across modules @@ -548,7 +548,7 @@ function dep_pass { for dup in ${duplicates}; do log_error "FAIL: inconsistent versions for dependency: ${dup}" - echo "${all_dependencies}" | grep "${dup}" | sed "s|\\([^,]*\\),\\([^,]*\\),\\([^,]*\\)| - \\1@\\2 from: \\3|g" + echo "${all_dependencies}" | grep "${dup}," | sed 's|\([^,]*\),\([^,]*\),\([^,]*\),\([^,]*\)| - \1@\2\3 from: \4|g' done if [[ -n "${duplicates}" ]]; then log_error "FAIL: inconsistent dependencies"