Skip to content

Commit 5506f1c

Browse files
authored
Merge pull request #9 from stevvooe/remove-depcrated-interfaces
digest: remove last of deprecated methods
2 parents 27f628c + 2616283 commit 5506f1c

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ out when using this package.
7676

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

79-
Right now, only two methods are marked as "deprecated", which may be
80-
removed before wider deployment.
81-
8279
As always, before using a package export, read the [godoc](https://godoc.org/github.com/docker/go-digest).
8380

8481
# Contributing

algorithm.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ func (a Algorithm) Digester() Digester {
8989
}
9090
}
9191

92-
// New is deprecated. Use Algorithm.Digester.
93-
func (a Algorithm) New() Digester {
94-
return a.Digester()
95-
}
96-
9792
// Hash returns a new hash as used by the algorithm. If not available, the
9893
// method will panic. Check Algorithm.Available() before calling.
9994
func (a Algorithm) Hash() hash.Hash {
@@ -118,7 +113,7 @@ func (a Algorithm) Hash() hash.Hash {
118113

119114
// FromReader returns the digest of the reader using the algorithm.
120115
func (a Algorithm) FromReader(rd io.Reader) (Digest, error) {
121-
digester := a.New()
116+
digester := a.Digester()
122117

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

130125
// FromBytes digests the input and returns a Digest.
131126
func (a Algorithm) FromBytes(p []byte) Digest {
132-
digester := a.New()
127+
digester := a.Digester()
133128

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

0 commit comments

Comments
 (0)