feat: replace github.com/pkg/errors to errors

Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
haoyun
2022-01-07 10:19:31 +08:00
parent 3ccd43c8f6
commit bbe46b8c43
299 changed files with 1896 additions and 1874 deletions

View File

@@ -31,7 +31,6 @@ import (
"strings"
"text/template"
"github.com/pkg/errors"
exec "golang.org/x/sys/execabs"
)
@@ -125,7 +124,7 @@ func loadData(name string) (*data, error) {
}
ver, err := getVersion()
if err != nil {
return nil, errors.Wrap(err, "get apparmor_parser version")
return nil, fmt.Errorf("get apparmor_parser version: %w", err)
}
p.Version = ver
@@ -152,7 +151,7 @@ func generate(p *data, o io.Writer) error {
func load(path string) error {
out, err := aaParser("-Kr", path)
if err != nil {
return errors.Errorf("%s: %s", err, out)
return fmt.Errorf("%s: %s", err, out)
}
return nil
}