On Tue, Apr 13, 2021 at 11:40 AM Tenjin <jdiscordbusin...@gmail.com> wrote:

> So I am using WSL2 to develop using golang but for some reason I am unable to 
> use other peoples packages.
> For example: I am wanting to use the sql driver 
> https://github.com/go-sql-driver/mysql I am able to go get it and it says it 
> is downloading then it downloads but when I go to use it in my project it 
> just says there is no go mod file, so I was going to use that to manage 
> packages but when I run "go init" it just says initializing git repo and then 
> does not create a go mod file.
> I do not mind which way I have to use to get the driver working I just need 
> to get it working. One more thing, I cannot install any packages its not just 
> the sql driver.

In your module directory:

$ go mod init example.com/foo/bar
$ go mod tidy
$ GO111MODULE=on go build -v -x

The last line just verifies if it works and should possibly reveal why, if not.

> Here is my gopath: /home/<username>/go

In your setup the value of $GOPATH should not matter.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-U5ZcVFY0LY7QxA1TFYpMuz5btaDxO2iKc_6jf4aW-Jxw%40mail.gmail.com.

Reply via email to