1
0
mirror of https://github.com/distribution/distribution synced 2024-11-12 05:45:51 +01:00
distribution/notifications
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
..
bridge_test.go Simplify digest.FromBytes calling convention 2015-12-14 14:30:51 -08:00
bridge.go Simplify digest.FromBytes calling convention 2015-12-14 14:30:51 -08:00
endpoint.go Move notifications package to distribution 2015-02-12 14:40:35 -08:00
event_test.go Move manifest package to schema1 2015-08-21 16:29:47 -07:00
event.go Use "Size" field to describe blobs over "Length" 2015-07-17 17:07:11 -07:00
http_test.go Move manifest package to schema1 2015-08-21 16:29:47 -07:00
http.go Address possible goroutine leak in notification library 2015-04-29 18:31:01 -07:00
listener_test.go Simplify digest.FromBytes calling convention 2015-12-14 14:30:51 -08:00
listener.go Move manifest package to schema1 2015-08-21 16:29:47 -07:00
metrics.go Move notifications package to distribution 2015-02-12 14:40:35 -08:00
sinks_test.go Move notifications package to distribution 2015-02-12 14:40:35 -08:00
sinks.go fix some typos in source comments 2015-04-17 12:39:52 +00:00