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

assignment mismatch: 2 variables but uuid.NewV4 returns 1 values #34280

Closed
chingiz2387 opened this issue Sep 13, 2019 · 3 comments
Closed

assignment mismatch: 2 variables but uuid.NewV4 returns 1 values #34280

chingiz2387 opened this issue Sep 13, 2019 · 3 comments

Comments

@chingiz2387
Copy link

What version of Go are you using (go version)?

$ go version
 go version go1.12.9 windows/amd64

Does this issue reproduce with the latest release?

No, is not last version

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\00046605\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\myProject\Go\
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\myProject\oauth\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\00046605\AppData\Local\Temp\go-build393022486=/tmp/go-build -gno-record-gcc-switches

What did you do?

Hello everyone, I started experimenting with mod. When I initialize the modules in my project, all libraries are loaded and github.com/satori/go.uuid is loaded accordingly.. But when starting go run server.go

What did you expect to see?

start without errors

What did you see instead?

I get an error {
"resource": "/d:/myProject/oauth/tokenstore/tokenstore.go",
"owner": "generated_diagnostic_collection_name#0",
"severity": 8,
"message": "cannot initialize 2 variables with 1 values",
"source": "LSP",
"startLineNumber": 41,
"startColumn": 20,
"endLineNumber": 41,
"endColumn": 30
}

image

I am using vscode.

My project is outside gopath

@ianlancetaylor
Copy link
Member

How can we recreate the problem?

@agnivade
Copy link
Contributor

This is an old and very well-known breakage. satori/go.uuid broke the public API here satori/go.uuid#66. When you shifted to modules, it took the latest stable release which had 1 variable.

A good tldr is here - satori/go.uuid#66 (comment)

So either lock to a newer version or wrap them with uuid.Must.

Folks have even forked it here - https://github.com/gofrs/uuid.

I am going to close the issue as this is not a bug in Go.

@Fercho120
Copy link

Thanks I got the same issue after migrating to modules for workaround a bug with grpc

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

No branches or pull requests

5 participants