diff --git a/go.mod b/go.mod index 415ecdc..397e5b3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/open-policy-agent/opa v0.67.0 github.com/opencontainers/image-spec v1.1.0 github.com/package-url/packageurl-go v0.1.3 - github.com/pkg/errors v0.9.1 github.com/secure-systems-lab/go-securesystemslib v0.8.0 github.com/sigstore/cosign/v2 v2.3.0 github.com/sigstore/rekor v1.3.6 @@ -136,6 +135,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.19.1 // indirect diff --git a/pkg/oci/layout.go b/pkg/oci/layout.go index eecc79e..2349ad8 100644 --- a/pkg/oci/layout.go +++ b/pkg/oci/layout.go @@ -9,7 +9,6 @@ import ( att "github.com/docker/attest/pkg/attestation" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1/layout" - "github.com/pkg/errors" ) // implementation of AttestationResolver that closes over attestations from an oci layout @@ -140,5 +139,5 @@ func attestationManifestFromOCILayout(path string, platform *v1.Platform) (*atte } return attest, nil } - return nil, errors.New("attestation manifest not found") + return nil, fmt.Errorf("attestation manifest not found") } diff --git a/pkg/oci/oci.go b/pkg/oci/oci.go index 438348f..d96c63b 100644 --- a/pkg/oci/oci.go +++ b/pkg/oci/oci.go @@ -15,7 +15,6 @@ import ( "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/common" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/package-url/packageurl-go" - "github.com/pkg/errors" ) // ParsePlatform parses the provided platform string or attempts to obtain @@ -82,7 +81,7 @@ func imageDescriptor(ix *v1.IndexManifest, platform *v1.Platform) (*v1.Descripto return &m, nil } } - return nil, errors.New(fmt.Sprintf("no image found for platform %v", platform)) + return nil, fmt.Errorf("no image found for platform %v", platform) } func attestationDigestForDigest(ix *v1.IndexManifest, imageDigest string, attestType string) (string, error) { @@ -93,7 +92,7 @@ func attestationDigestForDigest(ix *v1.IndexManifest, imageDigest string, attest } } } - return "", errors.New(fmt.Sprintf("no attestation found for image %s", imageDigest)) + return "", fmt.Errorf("no attestation found for image %s", imageDigest) } func RefToPURL(ref string, platform *v1.Platform) (string, bool, error) {