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)
| 20 | // FromBytes returns a UUID generated from the raw byte slice input. |
| 21 | // It will return an error if the slice isn't 16 bytes long. |
| 22 | func FromBytes(input []byte) (UUID, error) { |
| 23 | u := UUID{} |
| 24 | err := u.UnmarshalBinary(input) |
| 25 | return u, err |
| 26 | } |
| 27 | |
| 28 | // FromBytesOrNil returns a UUID generated from the raw byte slice input. |
| 29 | // Same behavior as FromBytes(), but returns uuid.Nil instead of an error. |
no test coverage detected
searching dependent graphs…