rootcentos21 go# go get govaluate$GOPATHgomod exists but should not
The error message suggests that the go.mod file already exists in the $GOPATH directory, but it should not.
To resolve this issue, you can either delete the existing go.mod file or rename it to a different name. Here's how you can do it:
-
Navigate to the
$GOPATHdirectory:cd $GOPATH -
Check if the
go.modfile exists:ls go.mod -
If the file exists, you can either delete it or rename it to a different name. Here are two options:
a. Delete the
go.modfile:rm go.modb. Rename the
go.modfile:mv go.mod go.mod.backup
After deleting or renaming the go.mod file, you should be able to run the go get command without the error message
原文地址: https://www.cveoy.top/t/topic/h3WK 著作权归作者所有。请勿转载和采集!