Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
marshal: Add an error when UUID has wrong length (#890)
* marshal: Add expectations to errors for Marshaling What === Add explicit expectations to exactly what error is returned in test cases where the marshal and unmarshal results in an error. Why === In cases where an unmarshal fails the presence of an error was expected but not what error was returned. Marshal is not tested for the cases where it fails in the table tests. Both of these are needed to add more tests that test for new errors being returned. * marshal: Add an error when UUID has wrong length What === Add a descriptive error when a UUID is attempted to be marshaled or unmarshaled and the length of the []byte is not exactly 16 bytes long. Example === ``` can not marshal []byte 6 bytes long into timeuuid, must be exactly 16 bytes long ``` Why === In cases where UUID []byte was not the correct length the generic `can not marshal %T into %s` error was being returned. The error was misleading because it gave the impression the root cause was the type of the data and not it's length. Additionally the `%T` formatter for a `[]byte` prints out `[]uint8` which was even more confusing. * authors: Add Leigh McCulloch to AUTHORS What === Add `Leigh McCulloch` to AUTHORS. Why === As part of his first contribution.
- Loading branch information