mirror of
https://github.com/google/uuid.git
synced 2024-11-21 17:16:42 +02:00
refactor (*UUID).UnmarshalText (#58)
Now it's easier to set breakpoint on error for debugging.
This commit is contained in:
parent
bd45158498
commit
cb32006e48
@ -16,10 +16,11 @@ func (uuid UUID) MarshalText() ([]byte, error) {
|
||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||
func (uuid *UUID) UnmarshalText(data []byte) error {
|
||||
id, err := ParseBytes(data)
|
||||
if err == nil {
|
||||
*uuid = id
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
*uuid = id
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary implements encoding.BinaryMarshaler.
|
||||
|
Loading…
Reference in New Issue
Block a user