Build Error: GOPATH set to GOROOT (C:\Users\Admin\go) has no effect, cannot find main module

1.5k views Asked by At
package main
import "fmt"

    func main() {
    fmt.Println("hello world")
}

Its my first code, but ended up with this error, I tried many times to resolve issues like this in VSCode.

Build Error:

warning: GOPATH set to GOROOT (C:\Users\Admin\go) has no effect go: cannot find main module, but found .git/config in d:\GO\practise to create a module there, run: go mod init (exit status 1)

0

There are 0 answers