Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

fix: UUID error #437

Closed
wants to merge 2 commits into from
Closed

Conversation

arrayindex-dev
Copy link

Fix for the error error multiple-value uuid.NewV4() in single-value context.

Replaced uuid.NewV4().String() with uuid.Must(uuid.NewV4()).String()

Copy link
Collaborator

@sshaplygin sshaplygin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, pls resolve some comments

redis_broadcast.go Show resolved Hide resolved
redis_broadcast.go Show resolved Hide resolved
redis_broadcast.go Outdated Show resolved Hide resolved
@sshaplygin sshaplygin changed the title Fix UUID error fix: UUID error Apr 16, 2021
@arrayindex-dev
Copy link
Author

See updated 👍

@@ -115,15 +119,10 @@ func newRedisBroadcast(nsp string, adapter *RedisAdapterOptions) (*redisBroadcas
return nil, err
}
sub, err := redis.Dial("tcp", redisAddr)
if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you delete error check?

bc.pub = redis.PubSubConn{Conn: pub}
bc.sub = redis.PubSubConn{Conn: sub}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this space :(

redis_broadcast.go Show resolved Hide resolved
@@ -89,6 +89,10 @@ type allRoomResponse struct {
Rooms []string
}

func genUUID() string{
return uuid.Must(uuid.NewV4()).String()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version uuid - https://github.com/googollee/go-socket.io/blob/master/go.mod#L9

not correct usage uuid.Must compile error by v1.2.0
have (uuid.UUID)
want (uuid.UUID, error)

satori/go.uuid#111

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need download mod uuid by hash commit

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine. It will never throw an error. Must will make it panic instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use this command at main go-socket.io directory.
go get github.com/satori/go.uuid@b2ce2384e17bbe0c6d34077efa39dbab3e09123b

@sshaplygin
Copy link
Collaborator

Thanks for help, but it does nit actually :(

@sshaplygin sshaplygin closed this May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants