老师请问这个是什么问题啊?missing dot in first path element
来源:13-1 http标准库
qq_自_3
2021-02-12
E:\go\src\go_test\errhandling>go run web.go
build command-line-arguments: cannot load go_test/errhandling/fileList: malformed module path “go_test/errhandling/fileList”: missing dot in first
path element
老师,这个会是什么问题
main方法路径:
E:\go\src\go_test\errhandling\web.go
gopath: E:\go
引用包的路径:e:\go\src\go_test\errhandling\fileList\far.go
代码:
import (
"fmt"
har “go_test/errhandling/fileList”
“log”
“net/http”
“os”
“reflect”
)
老师,后面我把set GO111MODULE=off 他就可以了,说明就是因为弄了on,才没有去gopath中找我的包,但是如果弄成off,岂不是拿不了远程的包了吗?
写回答
1回答
-
ccmouse
2021-02-21
改成on之后需要在go_test下面有一个go.mod,并且里面的module名为go_test。如果没有go.mod可以用go init go_test生成
00
相似问题