当前位置:网站首页>Solutions to prompt non standard import in go language

Solutions to prompt non standard import in go language

2022-06-22 09:24:00 ootw

I'm just learning GO, Basically, it belongs to one of the dishes . Today, I need to write a gadget SQLite, So from the SQLite Download the installation package on the official website and install it . Everything went well at first , But I am prompted when compiling :

non-standard import "github.com/mattn/go-sqlite3" in standard package "iislog"

I have searched the Internet for a long time, but I haven't found any relevant content , Then turn [ harmonious ] Google the wall , Find a foreign answer . I mean :

GO There are two paths that need to be defined , One is GO Own installation directory GOROOT, This directory can only hold standard packages , That is to say ”standart packages“. The other is GOPATH, It's the working directory , This is used to store third-party packages , That is to say “non-standard packages”.

So when I use go get github.com/mattn/go-sqlite3 when , It's put GOROOT In the , I moved it to GOPATH in , The problem is solved .

As for how GOROOT and GOPATH, Enter... On the command line : go env You can see .

If there are any questions , Welcome to leave a message , Let's make progress together .

原网站

版权声明
本文为[ootw]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220523181794.html