remove github.com/pkg/errors from dependencies

It's not needed any more with Go 1.13 as we have wrapping/unwrapping in base
packages. All errors.Wrap calls are replaced with fmt.Errorf, some strings are
improved along the way.
This commit is contained in:
Roman Khimov 2020-08-06 17:44:08 +03:00
parent 6e5920cc09
commit 5ef08f60ae
30 changed files with 90 additions and 95 deletions

View file

@ -15,7 +15,6 @@ import (
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
"github.com/nspcc-dev/neo-go/pkg/smartcontract/nef"
"github.com/pkg/errors"
"golang.org/x/tools/go/loader"
)
@ -179,11 +178,11 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
if o.ManifestFile != "" {
m, err := di.ConvertToManifest(o.ContractFeatures, o.ContractSupportedStandards...)
if err != nil {
return b, errors.Wrap(err, "failed to convert debug info to manifest")
return b, fmt.Errorf("failed to convert debug info to manifest: %w", err)
}
mData, err := json.Marshal(m)
if err != nil {
return b, errors.Wrap(err, "failed to marshal manifest")
return b, fmt.Errorf("failed to marshal manifest to JSON: %w", err)
}
return b, ioutil.WriteFile(o.ManifestFile, mData, os.ModePerm)
}