feat: Errorf usage

Signed-off-by: haoyun <yun.hao@daocloud.io>
This commit is contained in:
haoyun
2021-12-13 14:31:53 +08:00
parent a04656c1dd
commit c0d07094be
30 changed files with 80 additions and 80 deletions

View File

@@ -141,7 +141,7 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt
}
if mfsts == nil {
return ocispec.Descriptor{}, errors.Errorf("unrecognized image format")
return ocispec.Descriptor{}, errors.New("unrecognized image format")
}
for name, linkname := range symlinks {

View File

@@ -33,17 +33,17 @@ import (
var (
// ErrSkipDesc is used to skip processing of a descriptor and
// its descendants.
ErrSkipDesc = fmt.Errorf("skip descriptor")
ErrSkipDesc = errors.New("skip descriptor")
// ErrStopHandler is used to signify that the descriptor
// has been handled and should not be handled further.
// This applies only to a single descriptor in a handler
// chain and does not apply to descendant descriptors.
ErrStopHandler = fmt.Errorf("stop handler")
ErrStopHandler = errors.New("stop handler")
// ErrEmptyWalk is used when the WalkNotEmpty handlers return no
// children (e.g.: they were filtered out).
ErrEmptyWalk = fmt.Errorf("image might be filtered out")
ErrEmptyWalk = errors.New("image might be filtered out")
)
// Handler handles image manifests