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/c71e539f-3926-4fb0-b3bb-92e3d2c19dff%40googlegroups.com.

Reply via email to