mirror of
https://github.com/containers/skopeo.git
synced 2025-09-05 00:31:45 +00:00
fix(deps): update module github.com/containers/image/v5 to v5.32.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
20
vendor/github.com/google/go-containerregistry/pkg/name/digest.go
generated
vendored
20
vendor/github.com/google/go-containerregistry/pkg/name/digest.go
generated
vendored
@@ -17,6 +17,7 @@ package name
|
||||
import (
|
||||
// nolint: depguard
|
||||
_ "crypto/sha256" // Recommended by go-digest.
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/opencontainers/go-digest"
|
||||
@@ -59,6 +60,25 @@ func (d Digest) String() string {
|
||||
return d.original
|
||||
}
|
||||
|
||||
// MarshalJSON formats the digest into a string for JSON serialization.
|
||||
func (d Digest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(d.String())
|
||||
}
|
||||
|
||||
// UnmarshalJSON parses a JSON string into a Digest.
|
||||
func (d *Digest) UnmarshalJSON(data []byte) error {
|
||||
var s string
|
||||
if err := json.Unmarshal(data, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
n, err := NewDigest(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*d = n
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDigest returns a new Digest representing the given name.
|
||||
func NewDigest(name string, opts ...Option) (Digest, error) {
|
||||
// Split on "@"
|
||||
|
Reference in New Issue
Block a user