Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digest: remove last of deprecated methods #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ out when using this package.

The Go API, at this stage, is considered stable, unless otherwise noted.

Right now, only two methods are marked as "deprecated", which may be
removed before wider deployment.

As always, before using a package export, read the [godoc](https://godoc.org/github.com/docker/go-digest).

# Contributing
Expand Down
9 changes: 2 additions & 7 deletions algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ func (a Algorithm) Digester() Digester {
}
}

// New is deprecated. Use Algorithm.Digester.
func (a Algorithm) New() Digester {
return a.Digester()
}

// Hash returns a new hash as used by the algorithm. If not available, the
// method will panic. Check Algorithm.Available() before calling.
func (a Algorithm) Hash() hash.Hash {
Expand All @@ -118,7 +113,7 @@ func (a Algorithm) Hash() hash.Hash {

// FromReader returns the digest of the reader using the algorithm.
func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {
digester := a.New()
digester := a.Digester()

if _, err := io.Copy(digester.Hash(), rd); err != nil {
return "", err
Expand All @@ -129,7 +124,7 @@ func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {

// FromBytes digests the input and returns a Digest.
func (a Algorithm) FromBytes(p []byte) Digest {
digester := a.New()
digester := a.Digester()

if _, err := digester.Hash().Write(p); err != nil {
// Writes to a Hash should never fail. None of the existing
Expand Down