UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. It will return an error if the slice isn't 16 bytes long.
(data []byte)
| 228 | // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. |
| 229 | // It will return an error if the slice isn't 16 bytes long. |
| 230 | func (u *UUID) UnmarshalBinary(data []byte) error { |
| 231 | if len(data) != Size { |
| 232 | return fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data)) |
| 233 | } |
| 234 | copy(u[:], data) |
| 235 | |
| 236 | return nil |
| 237 | } |
no test coverage detected