diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2021-09-13 12:29:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 12:29:39 +0000 |
commit | eec59cea2c20cf5e515bdcbc8c35eba3e07da607 (patch) | |
tree | 71ec92fd12f16d15f25facd599ef097c2650c5f9 /vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil | |
parent | 0f3d3bd21da0b67542c44c832f0e1642c5f639cf (diff) | |
download | podman-eec59cea2c20cf5e515bdcbc8c35eba3e07da607.tar.gz podman-eec59cea2c20cf5e515bdcbc8c35eba3e07da607.tar.bz2 podman-eec59cea2c20cf5e515bdcbc8c35eba3e07da607.zip |
Bump github.com/containers/storage from 1.35.0 to 1.36.0
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.35.0 to 1.36.0.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.35.0...v1.36.0)
---
updated-dependencies:
- dependency-name: github.com/containers/storage
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil')
-rw-r--r-- | vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go new file mode 100644 index 000000000..6de78b02d --- /dev/null +++ b/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go @@ -0,0 +1,40 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package errorutil + +import ( + "errors" + "fmt" + "strings" +) + +// Aggregate combines a list of errors into a single new error. +func Aggregate(errs []error) error { + switch len(errs) { + case 0: + return nil + case 1: + return errs[0] + default: + points := make([]string, len(errs)+1) + points[0] = fmt.Sprintf("%d error(s) occurred:", len(errs)) + for i, err := range errs { + points[i+1] = fmt.Sprintf("* %s", err) + } + return errors.New(strings.Join(points, "\n\t")) + } +} |