Skip to content
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

not enough arguments in call to uuid.Must #70

Closed
ankitsny opened this issue Jan 18, 2018 · 13 comments
Closed

not enough arguments in call to uuid.Must #70

ankitsny opened this issue Jan 18, 2018 · 13 comments

Comments

@ankitsny
Copy link

not enough arguments in call to uuid.Must
have (uuid.UUID)
want (uuid.UUID, error)

if I install the package using dep dep ensure -add github.com/satori/go.uuid, then Must function expects two arguments.

uuid := uuid.Must(uuid.NewV4(), errors.New("UUID Error"))

but if I install the package using go get github.com/satori/go.uuid, then Must function expects only 1 argument

uuid := uuid.Must(uuid.NewV4())

In both the cases 1.2 version is getting installed

@Sectorbob
Copy link

I am experiencing the same sort of behavior. go get -u places the correct revision (I assume), while dep init or dep ensure are causing the vendor/ contents to act awry.

@macrael
Copy link

macrael commented Jan 25, 2018

See #66

kevinburke added a commit to kevinburke/go.uuid that referenced this issue Jan 25, 2018
This new function can support the desired feature (return error
instead of panic) without having to break compatibility for existing
clients.

Fixes satori#66.
Fixes satori#67.
Fixes satori#68.
Fixes satori#69.
Fixes satori#70.
@thurt
Copy link

thurt commented Feb 8, 2018

@anks333 i think you would get this error only if you are using the api from master but have 1.2 installed in vendor/

If anybody is coming here from Googling build errors and you're using dep then you'll need to change your Gopkg.toml to point to the master branch for go.uuid.

Like so:

[[override]]
name = "github.com/satori/go.uuid"
revision = "master"

@klj890
Copy link

klj890 commented Nov 15, 2018

I have a similar question.
I used go version 1.11.
When I use module , it will be prompted as follows:

➜ :  GO111MODULE=on go run app.go
# portal-for-gdt/model
model/uias.go:42:23: not enough arguments in call to uuid.Must
	have (uuid.UUID)
	want (uuid.UUID, error)

but, if set GO111MODULE=off , All is well。。。。
this is my code:

acc.State = uuid.Must(uuid.NewV4()).String()

@ai0376
Copy link

ai0376 commented Jan 19, 2019

$ go mod edit -replace=github.com/satori/go.uuid@v1.2.0=github.com/satori/go.uuid@master
$ go mod tidy
$ go build

It's will ok! @anks333

@jdharms
Copy link

jdharms commented May 3, 2019

@mjrao Thank you so much!

@hubyhuby
Copy link

I tried several of the options in this thread, but none worked for me on go 1.12.
I finally switch to github.com/gofrs/uuid and it worked instantaneously ! Even with GO111MODULE=on

@bheemreddy181-zz
Copy link

go get github.com/satori/go.uuid@master will work

@griffincox
Copy link

Thanks Bheem @bheemreddy181

@ShrawanLakhe
Copy link

Thanks @bheemreddy181

2 similar comments
@mengdodo
Copy link

Thanks @bheemreddy181

@ghost
Copy link

ghost commented Oct 20, 2020

Thanks @bheemreddy181

@LBiff
Copy link

LBiff commented Dec 19, 2020

go get github.com/satori/go.uuid@master will work

Thanks, good job!! But why it can be work?

“github.com/koding/kite” ==> this project also refers to the "master" with dep:

[[constraint]]
branch = "master"
name = "github.com/satori/go.uuid"

But that does not work with the follow error when i import it (github.com/koding/kite) directly to my own project.

not enough arguments in call to uuid.Must
have (uuid.UUID)
want (uuid.UUID, error)


But it can work when i command "go get xxx.uuid@master" or add "xxx.uuid master" to go.mod.

so, why? Hasn't this project been refered to master? why we need get the master branch agin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests