FromBytes returns a UUID generated from the raw byte slice input. It will return an error if the slice isn't 16 bytes long.
(input []byte)
| 25 | // FromBytes returns a UUID generated from the raw byte slice input. |
| 26 | // It will return an error if the slice isn't 16 bytes long. |
| 27 | func FromBytes(input []byte) (UUID, error) { |
| 28 | u := UUID{} |
| 29 | err := u.UnmarshalBinary(input) |
| 30 | return u, err |
| 31 | } |
| 32 | |
| 33 | // FromBytesOrNil returns a UUID generated from the raw byte slice input. |
| 34 | // Same behavior as FromBytes(), but returns uuid.Nil instead of an error. |
no test coverage detected
searching dependent graphs…