distribution/digest
Aaron Lehmann 31047c8113 Simplify digest.FromBytes calling convention
The current implementation of digest.FromBytes returns an error. This
error can never be non-nil, but its presence in the function signature
means each call site needs error handling code for an error that is
always nil.

I verified that none of the hash.Hash implementations in the standard
library can return an error on Write. Nor can any of the hash.Hash
implementations vendored in distribution.

This commit changes digest.FromBytes not to return an error. If Write
returns an error, it will panic, but as discussed above, this should
never happen.

This commit also avoids using a bytes.Reader to feed data into the hash
function in FromBytes. This makes the hypothetical case that would panic
a bit more explicit, and should also be more performant.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-14 14:30:51 -08:00
..
digest.go Simplify digest.FromBytes calling convention 2015-12-14 14:30:51 -08:00
digest_test.go Validate digest length on parsing 2015-12-02 16:04:06 -08:00
digester.go Validate digest length on parsing 2015-12-02 16:04:06 -08:00
digester_resumable_test.go Refactor specification of supported digests 2015-05-22 18:08:23 -07:00
doc.go Various adjustments to digest package for govet/golint 2014-11-19 14:59:05 -08:00
set.go Add remove and list functions to digest set 2015-09-29 10:04:15 -07:00
set_test.go Validate digest length on parsing 2015-12-02 16:04:06 -08:00
tarsum.go Correct two golint comment issues 2015-10-19 16:42:12 -07:00
tarsum_test.go digest: Minor refactoring 2015-03-10 16:44:19 -07:00
verifiers.go Refactor specification of supported digests 2015-05-22 18:08:23 -07:00
verifiers_test.go Simplify digest.FromBytes calling convention 2015-12-14 14:30:51 -08:00