diff options
Diffstat (limited to 'vendor/github.com/pborman/uuid/marshal.go')
-rw-r--r-- | vendor/github.com/pborman/uuid/marshal.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/github.com/pborman/uuid/marshal.go b/vendor/github.com/pborman/uuid/marshal.go index 6621dd54b..35b89352a 100644 --- a/vendor/github.com/pborman/uuid/marshal.go +++ b/vendor/github.com/pborman/uuid/marshal.go @@ -7,6 +7,8 @@ package uuid import ( "errors" "fmt" + + guuid "github.com/google/uuid" ) // MarshalText implements encoding.TextMarshaler. @@ -60,11 +62,11 @@ func (u Array) MarshalText() ([]byte, error) { // UnmarshalText implements encoding.TextUnmarshaler. func (u *Array) UnmarshalText(data []byte) error { - id := Parse(string(data)) - if id == nil { - return errors.New("invalid UUID") + id, err := guuid.ParseBytes(data) + if err != nil { + return err } - *u = id.Array() + *u = Array(id) return nil } |