My system is WSL 2 in Windows 10.
OS: Debian 10 buster
Kernel: x86_64 Linux 4.19.104-microsoft-standard
Shell: zsh 5.7.1
CPU: AMD Ryzen 9 4900HS with Radeon Graphics @ 16x 2.994GHz
Golang info:
go version go1.15.2 linux/amd64
GOROOT="/usr/local/go"
GOPATH="/mnt/c/workspace/6.824"
And I met a problem when I build a project by plugin model:
$ go build -buildmode=plugin ../mrapps/wc.go
build command-line-arguments: cannot find module for path _/mnt/c/workspace/6.824/src/mr
It is so strange that "_/mnt"
How can I solve it?
Why has a "_" before the path?
Help me, please.
2
Answers
I would try and use
go mod
instead of relying onGOPATH
You are using go mod. And you can try the following command to fix:
More details about mod you can refer to https://golang.org/ref/mod