go.uuid icon indicating copy to clipboard operation
go.uuid copied to clipboard

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

Open barry-en opened this issue 4 years ago • 6 comments

I use go mod go mod init root@efd4d3d775f2:/home/workspace/src/test# cat go.mod module test

go 1.13

require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/gin-gonic/gin v1.5.0 github.com/go-sql-driver/mysql v1.5.0 github.com/go-xorm/xorm v0.7.9 github.com/golang/protobuf v1.3.4 github.com/gomodule/redigo v2.0.0+incompatible github.com/micro/cli v0.2.0 github.com/micro/go-micro v1.18.0 github.com/micro/go-plugins/registry/consul v0.0.0-20200119172437-4fe21aa238fd github.com/pkg/errors v0.9.1 github.com/satori/go.uuid v1.2.0 )

barry-en avatar Mar 05 '20 16:03 barry-en

import( uuid "github.com/satori/go.uuid )

barry-en avatar Mar 05 '20 17:03 barry-en

同样遇到这个问题,是不是这个项目已经被弃坑了

Wyatex avatar Mar 30 '20 13:03 Wyatex

不用管IDE的报错提示,直接返回一个值就可以了

AIDeepx avatar Apr 06 '20 03:04 AIDeepx

I got the same issue after switch to GOMODULES. It was working in GOPATH mode. godoc also says NewV4 returns 2 values.

pjebs avatar Apr 09 '20 01:04 pjebs

Under GOMODULES mode, it uses the tag 1.2.0 instead of master which is the latest version.

Just do this: GO111MODULE=on go get -u github.com/satori/go.uuid@master

That will add this to go.mod file:

`github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b`

pjebs avatar Apr 09 '20 01:04 pjebs

@pjebs @aidy-automan @6qiongtao its important to audit a 3rd party library carefully when including it in your software. https://github.com/satori/go.uuid/issues/103 This repo has been dead for a long time, you should really use a different one.

DamareYoh avatar Apr 22 '20 21:04 DamareYoh