Looks good, given the difficulties with unit-testing in Go. Maybe in addition to testing that deliberately induced errors come out as non-nil, you could also cursorily check their contents.
Use the ErrorMatches checker to verify that an error matches a given regex:
// Don't care what else is in the error, but the original error message
// must be in there somewhere.
c.Check(err, ErrorMatches, ".*canned error.*")
Looks good, given the difficulties with unit-testing in Go. Maybe in addition to testing that deliberately induced errors come out as non-nil, you could also cursorily check their contents.
Use the ErrorMatches checker to verify that an error matches a given regex:
// Don't care what else is in the error, but the original error message
// must be in there somewhere.
c.Check(err, ErrorMatches, ".*canned error.*")