distribution/docs/client
Aaron Lehmann 58232e50cf 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
..
auth Add expires_in and issued_at to the auth spec. 2015-10-27 11:05:33 -07:00
transport Avoid stat round-trips when fetching a blob 2015-12-02 14:21:13 -08:00
blob_writer.go Add pull through cache functionality to the Registry which can be configured 2015-08-04 16:09:55 -07:00
blob_writer_test.go Add ability to pass in substitution args into an Error 2015-07-15 11:02:10 -07:00
errors.go Move common error codes to errcode package 2015-08-11 11:50:58 -07:00
repository.go Merge pull request #1243 from RichardScothern/client-header-message 2015-12-08 09:54:18 -08:00
repository_test.go Simplify digest.FromBytes calling convention 2015-12-14 14:30:51 -08:00