Skip to content

v2: UUID unmarshal bug #211

Closed
Closed
@romsar

Description

@romsar

I have that struct:

type Space struct {
	UUID uuid.UUID `json:"uuid" msgpack:"uuid"`
	Name string    `json:"name" msgpack:"name"`
}

So I do simple marshal/unmarshal:

space := &comments.Space{}

b, err := msgpack.Marshal(&comments.Space{UUID: uuid.New(), Name: "foo bar"})

var item comments.Space
err = msgpack.Unmarshal(b, &item)

fmt.Println(item) // UUID: 123e4567-e89b-12d3-a456-426614174000 Name: ""

As you can see Name is empty after unmashalling, but It have to be "foo bar".

If I use https://github.com/citilinkru/uuid-msgpack the code above will work good and name will be "foo bar", but I can't combine both packages because of conflicts.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions