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:

  1. Navigate to the $GOPATH directory:

    cd $GOPATH
    
  2. Check if the go.mod file exists:

    ls go.mod
    
  3. If the file exists, you can either delete it or rename it to a different name. Here are two options:

    a. Delete the go.mod file:

    rm go.mod
    

    b. Rename the go.mod file:

    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

rootcentos21 go# go get govaluate$GOPATHgomod exists but should not

原文地址: https://www.cveoy.top/t/topic/h3WK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录