简体   繁体   中英

JetBrains $GOPATH/go.mod exists but should not

Very simple code is not working. Can't find what's problem. In console no one request didn't work. Because I dont know how use go-terminal in console. Maybe I can change some settings?

go.mod contains module "awesomeProject"

package main

import "fmt"

func main() {
    fmt.Println("some text")
}

GOROOT=C:\Users\olli\sdk\go1.16.3 #gosetup

GOPATH=D:\Projects\GoLang #gosetup

C:\Users\olli\sdk\go1.16.3\bin\go.exe build -o C:\Users\olli\AppData\Local\Temp___go_build_awesomeProject.exe awesomeProject #gosetup

$GOPATH/go.mod exists but should not

Compilation finished with exit code 1

UPD: I didn't fix the problem, just erased it and installed everything in the base folders, without changing it, and everything worked.

try to initialize the module with;

go mod init awesomeProject

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM