I finally understood. The GOPATH definition is not relevant here. It is the 
presence of the go.mod file that determines if the module mode is in 
application. With go1.13, without go.mod file, the old GOPATH mode is in 
application. 

The go.mod file is create by "go mod init [package name]". When present, a 
"go get" will download and install all dependencies. 

Sorry for the noise. 

Le mardi 1 octobre 2019 08:59:55 UTC+2, Christophe Meessen a écrit :
>
> When GOPATH is defined (~/go), 
>
>     go get -u github.com/XXX/go-YYY@latest
>
> doesn’t work. I get the error message:
>
>     go: cannot use path@version syntax in GOPATH mode
>
> This is with go1.13.1. 
>
> Does this mean that GOPATH must be undefined to use modules with 1.13.1 ? 
> I thought that with go1.13 modules was used everywhere. 
> The rules are non-intuitive and not explicit. 
>
> Le lundi 30 septembre 2019 11:17:11 UTC+2, Christophe Meessen a écrit :
>>
>> Solved the issue with the command:
>>
>>     go get -u github.com/XXX/go-YYY@latest
>>
>> Is there another way  ? 
>>
>> Le lundi 30 septembre 2019 11:01:17 UTC+2, Christophe Meessen a écrit :
>>>
>>> I have a small go program to test a third party package stored on 
>>> github. 
>>> I’m using go1.13.1 with no GOPATH defined. Code is in ~/go/src. 
>>>
>>> When I first tried to compile the program, there was an error in the 
>>> third party package. I submitted a pull request to fix it and the manager 
>>> merged it. 
>>>
>>> The problem I’m facing now is that I can’t get go to use the newest 
>>> version of the package. 
>>>
>>> If I remove the require line in the go.mod file and do a go get, or go 
>>> get -u, or go get -u <package>, I always get the older package although go 
>>> prints the message "go: finding github.com/XXX/go-YYY latest". It’s 
>>> definitely not the latest. 
>>> I’m stuck now and don’t know how to download the really latest version 
>>> of the package. 
>>>
>>> I guess I’m not supposed to manually clean the go cache (~/go/src/mod/
>>> github.com/XXX/go-YYY@...), or am I ? 
>>>
>>

-- 
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/e7fb2f66-c0d7-407a-a6d6-0527d14036ad%40googlegroups.com.

Reply via email to