# 'go mod edit' opportunistically locks the side-lock file in the module cache, | |
# for compatibility with older versions of the 'go' command. | |
# It does not otherwise depend on the module cache, so it should not | |
# fail if the module cache directory cannot be created. | |
[root] skip | |
mkdir $WORK/readonly | |
chmod 0555 $WORK/readonly | |
env GOPATH=$WORK/readonly/nonexist | |
go mod edit -go=1.17 | |
-- go.mod -- | |
module example.com/m |