-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot install using go 1.18.1 #25
Comments
Hi, I have Go 1.18.0 and all is working fine. |
@ostafen thanks for your prompt reply. I didn't have a different version of UUID. I just removed and it and it installed again satori/go.uuid |
Is the version you are getting installed v1.2.0? |
yes it is the default one required in your .mod package. I also tried to delete it and run again the go get go get github.com/ostafen/clover but I get the same error. I am using Mac OS X I can try to downgrade to go 1.18.0 but it seems that by default the go.dev sites only proposes the 1.18.1 |
The thing which looks quite strange to me is that, according to the error, it seems that the API returns 2 values, instead of one. This could only be due to a different version of the uuid package being installed. |
@ostafen thanks a lot much appreciated. I will also try to downgrade to see if the error persists. |
@ostafen no luck with go 1.18
I deleted the previous packages before attempting to reinstall |
Can you give the output of the following command? go list -m all | grep github.com/satori/go.uuid I think that the error is not related with the go version |
try to delete the module and execute this: GO111MODULE=on go get github.com/satori/go.uuid@063359185d32c6b045fa171ad7033ea545864fa1 |
go list -m all | grep github.com/satori/go.uuid github.com/satori/go.uuid v1.2.0 |
gurugeek@Davids-iMac clover % GO111MODULE=on go get github.com/satori/go.uuid@063359185d32c6b045fa171ad7033ea545864fa1 but back to my directory when I try the example I now get this error with GO111MODULE=on
my main.go is
it seems to be related to mysystem using GO111MODULE=off. gurugeek@Davids-iMac go-experiments % go get github.com/satori/go.uuid github.com/ostafen/clover../../../go/src/github.com/ostafen/clover/db.go:49:9: multiple-value uuid.NewV4() (value of type (uuid.UUID, error)) in single-value context |
So did you fix? I also checked the version which is installed on my system. If I run the go list command, I also get the output: github.com/satori/go.uuid v1.2.0. You could try to check inside the code of the github.com/satori/go.uuid code, in your pkg folder. // NewV4 returns random generated UUID. Check if it is true that you have a different version of the function, returning two values (as the error message seems to suggest). |
No, I didn't fix it. Just to clarify I am installing clover as per readme with the go get command and not with go install. So I removed it, ncluding the UUID package, and I get:
inside db.go on line 49 I have a different code:
perhaps go get fetches a different version ? |
That snippet is inside clover. It is fine. The problem is with the |
this is the code inside uuid.go as fetched by go get once I fetch clover:
|
This file doesn't contain the definition of the NewV4() function. It should be contained in the generator.go file |
here it is
|
Ok, this is the proof you are getting a different version of the library (if you look at the one I posted, there is a mismatch in the number of returned values). |
@ostafen thanks a lot for your quick comments. Just to clarify the version fetched by go get is exactly the version available in github The go mod for clover specifies 1.2.0 as a version so I think go get does fetch what is asked. I assume that most of the users use go install ? With go get is definitely not working even on go 1.15 I just tried in a completely different, clean server
Happy to help debugging if needed. |
The problem here is not that clover depends on a specific commit, because as you can see, the version specified is v1. 2.0 (in fact several user using clover didn't have this problem). If the version you get is the same which in github is tagged as v1.2.0, we have to understand why other user (me included) get an older version instead of the correct one. I will do further tests, trying to clean my module cache and use go get In every case, googling a bit, other people had this issue, too, using uuid. |
In understood what it's going on by reading this satori/go.uuid#106. Try to:
Dependencies should be automatically fetched when you run the main.go file |
Thank you @ostafen but I don't wish to use GOMODULES as I have a lot of legacy code working fine with go get. If this is a pre-requisite to use Clover, I suggest you change the readme because go get will definitely not work. As a side note/suggestion as this package appears to be a crucial dependency in clover and there is a mismatch between main and the version you want to use, it might be worth consider forking it then it will work fine. I am slowing moving back to go after a lot of NPM dependencies issues in node so I also tend to stay away from anything that depends on something unmaintained to run. |
Wait, it's improper to say that clover doesn't work with go get. You could also enable GOMODULES on the fly only while fetching a particular library. GOMODULE111=on go get github.com/ostafen/clover If this works for you, I will update the README with this command |
@ostafen sorry I didn't meant to criticize your work, just trying to give the prospective of someone trying to install using the command on the readme. Unfortunately the last options doesn't work
strange! |
Sorry, I made a mistake in writing the environment variable. I wrote GO111MODULE=on go get github.com/ostafen/clover
Don't worry, I was just trying to explain that it's all about instructing |
@ostafen thanks again for your support. Allright that works in principle but:
so I had to create a mod.go file and then this code:
eventually works
I am sure it is certainly my fault for not being used to the go mod system (in previous versions it didn't exist) but perhaps an example folder with a sample mod file and runnable script will be of help to go newbies :) Thanks again, this is solved now. |
Well! Code samples are planned. |
thank you @ostafen much appreciated! |
It seems that the package id not running perhaps for a breaking change on the UUID package
The text was updated successfully, but these errors were encountered: