improt导入文件的时候,路径的大小写没写对。Mac下编译通过,但是docker和centos下编译不了。
===
运行如下报错:
[root@localhost ginlaravel]# go run server.go
routes/route.go:19:2: cannot find package "." in:
/home/wwwroot/go/src/ginlaravel/app/http/Controller
routes/route.go:20:2: cannot find package "." in:
/home/wwwroot/go/src/ginlaravel/app/http/Controller/Gen1Controller
或运行如下会报错:
[root@localhost ginlaravel]# go build -mod=mod
routes/route.go:19:2: package ginlaravel/app/http/Controller is not in GOROOT (/usr/local/go/src/ginlaravel/app/http/Controller)
routes/route.go:20:2: package ginlaravel/app/http/Controller/Gen1Controller is not in GOROOT (/usr/local/go/src/ginlaravel/app/http/Controller/Gen1Controller)
如上两个实际上是将自定义的空间命名路径大写的Http写了小写。
-
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)