forked from TrueCloudLab/distribution
31047c8113
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> |
||
---|---|---|
.. | ||
api_test.go | ||
app.go | ||
app_test.go | ||
basicauth.go | ||
basicauth_prego14.go | ||
blob.go | ||
blobupload.go | ||
catalog.go | ||
context.go | ||
health_test.go | ||
helpers.go | ||
hmac.go | ||
hmac_test.go | ||
hooks.go | ||
images.go | ||
mail.go | ||
tags.go |