forked from mirror/go.uuid
Added error messages prefix
This commit is contained in:
parent
3d29736e97
commit
10f354ca4b
4
uuid.go
4
uuid.go
|
@ -185,7 +185,7 @@ func getTimestamp() uint64 {
|
||||||
// It will return error if the slice isn't 16 bytes long.
|
// It will return error if the slice isn't 16 bytes long.
|
||||||
func FromBytes(input []byte) (u UUID, err error) {
|
func FromBytes(input []byte) (u UUID, err error) {
|
||||||
if len(input) != 16 {
|
if len(input) != 16 {
|
||||||
err = fmt.Errorf("UUID must be exactly 16 bytes long, got %d bytes", len(input))
|
err = fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(input))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ func FromString(input string) (u UUID, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(s) != 32 {
|
if len(s) != 32 {
|
||||||
err = fmt.Errorf("Invalid UUID string: %s", input)
|
err = fmt.Errorf("uuid: invalid UUID string: %s", input)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue