We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19c4db6 commit 3f2478aCopy full SHA for 3f2478a
verify_examples.sh
@@ -47,7 +47,12 @@ for dir in $PACKAGE_DIRS; do
47
printf " Update go.mod for $dir\n"
48
(cd "${DIR_TMP}/${dir}" && \
49
# replaces is ("mod1" "mod2" …)
50
- replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path')) && \
+ if [[ $(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace') == "null" ]]; then
51
+ echo "The 'Replace' field is null (no replace directives) for ${dir}."
52
+ replaces=() # Initialize as an empty array
53
+ else
54
+ replaces=($(go mod edit -json | ${TOOLS_DIR}/gojq '.Replace[].Old.Path'))
55
+ fi
56
# strip double quotes
57
replaces=("${replaces[@]%\"}") && \
58
replaces=("${replaces[@]#\"}") && \
0 commit comments