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

Remove dependency on github.com/hashicorp/go-multierror #2434

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
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ require (
github.com/fahedouch/go-logrotate v0.2.0
github.com/fatih/color v1.15.0
github.com/fluent/fluent-logger-golang v1.9.0
github.com/hashicorp/go-multierror v1.1.1
github.com/ipfs/go-cid v0.4.1
github.com/mattn/go-isatty v0.0.19
github.com/mitchellh/mapstructure v1.5.0
Expand Down Expand Up @@ -86,7 +85,6 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.16.7
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,12 @@ github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBt
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
Expand Down
3 changes: 1 addition & 2 deletions pkg/buildkitutil/buildkitutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"runtime"

"github.com/containerd/nerdctl/pkg/rootlessutil"
"github.com/hashicorp/go-multierror"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -84,7 +83,7 @@ func GetBuildkitHost(namespace string) (string, error) {
logrus.Debugf("Chosen buildkit host %q", buildkitHost)
return buildkitHost, nil
}
allErr = multierror.Append(allErr, fmt.Errorf("failed to ping to host %s: %w", buildkitHost, err))
allErr = errors.Join(allErr, fmt.Errorf("failed to ping to host %s: %w", buildkitHost, err))
}
logrus.WithError(allErr).Error(getHint())
return "", fmt.Errorf("no buildkit host is available, tried %d candidates: %w", len(hostRel), allErr)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/container/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ package container

import (
"context"
"errors"
"fmt"
"io"

"github.com/containerd/containerd"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/idutil/containerwalker"
"github.com/hashicorp/go-multierror"
)

// Wait blocks until all the containers specified by reqs have stopped, then print their exit codes.
Expand All @@ -50,7 +50,7 @@ func Wait(ctx context.Context, client *containerd.Client, reqs []string, options
w := options.Stdout
for _, container := range containers {
if waitErr := waitContainer(ctx, w, container); waitErr != nil {
allErr = multierror.Append(allErr, waitErr)
allErr = errors.Join(allErr, waitErr)
}
}
return allErr
Expand Down
3 changes: 1 addition & 2 deletions pkg/ipfs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
ipfsclient "github.com/containerd/stargz-snapshotter/ipfs/client"
"github.com/hashicorp/go-multierror"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -238,7 +237,7 @@ func (s *server) resolveCIDOfDigest(ctx context.Context, dgst digest.Digest, des
for _, desc := range descs {
gotCID, gotDesc, err := s.resolveCIDOfDigest(ctx, dgst, desc)
if err != nil {
allErr = multierror.Append(allErr, err)
allErr = errors.Join(allErr, err)
continue
}
return gotCID, gotDesc, nil
Expand Down