go.mod: update osbuild/images to v0.74.0
This commit is contained in:
parent
3789ff4ce8
commit
c9972f7da8
327 changed files with 8341 additions and 12785 deletions
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 "@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue