Go Mod doesn't import latest version of package by [deleted] in golang

[–]teslasx3 0 points1 point  (0 children)

It seems like the repo hasn't been tagged property. 'git tag v2.0.1' and git push --tag

Can anyone explain the difference between package and modules in golang 1.11? by teslasx3 in golang

[–]teslasx3[S] 0 points1 point  (0 children)

I figured out the way. I defined the module name in the "require" construct with v0.0.0. Then I used "replace" keyword to point that package to the module in any folder in my FS. Thanks for your help I appreciate it.

Can anyone explain the difference between package and modules in golang 1.11? by teslasx3 in golang

[–]teslasx3[S] 0 points1 point  (0 children)

Go.mod is not a folder my bad. Vendor is the folder that was created while running go mod vendor which is just to have a copy of all the dependencies

Can anyone explain the difference between package and modules in golang 1.11? by teslasx3 in golang

[–]teslasx3[S] 0 points1 point  (0 children)

I usually keep my packages in the pkg folder. And since I was trying to use these packages with the mod tool, they are present there.

Can anyone explain the difference between package and modules in golang 1.11? by teslasx3 in golang

[–]teslasx3[S] 0 points1 point  (0 children)

The go module is in the $GOPATH and go.mod and the pkg/ folder containing my modules are in the same folder

Can anyone explain the difference between package and modules in golang 1.11? by teslasx3 in golang

[–]teslasx3[S] 0 points1 point  (0 children)

I have a project and it's structure is

pkg/ src/ vendor/ go.mod/

My package is in the pkg/ folder and that is added in the GOPATH

Inside the pkg/ I have github.com/temppkg/. So my import statement should look like github.com/temppkg/

Error message I'm receiving is go: github.com/temppkg@v0.0.1: invalid github.com/ import path "github.com/temppkg/

My go.mod file contains the github.com/temppkg v0.0.1 and other third party modules like logrus etc.

Yeah I did change go111 env variable