diff options
Diffstat (limited to 'deps')
-rw-r--r-- | deps/deps.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/deps/deps.go b/deps/deps.go index a9e78860d..ece420302 100644 --- a/deps/deps.go +++ b/deps/deps.go @@ -1,12 +1,11 @@ package deps import ( + "fmt" "sync" "sync/atomic" "time" - "github.com/pkg/errors" - "github.com/gohugoio/hugo/cache/filecache" "github.com/gohugoio/hugo/common/hexec" "github.com/gohugoio/hugo/common/loggers" @@ -186,11 +185,11 @@ func (d *Deps) SetTextTmpl(tmpl tpl.TemplateParseFinder) { func (d *Deps) LoadResources() error { // Note that the translations need to be loaded before the templates. if err := d.translationProvider.Update(d); err != nil { - return errors.Wrap(err, "loading translations") + return fmt.Errorf("loading translations: %w", err) } if err := d.templateProvider.Update(d); err != nil { - return errors.Wrap(err, "loading templates") + return fmt.Errorf("loading templates: %w", err) } return nil @@ -236,18 +235,18 @@ func New(cfg DepsCfg) (*Deps, error) { securityConfig, err := security.DecodeConfig(cfg.Cfg) if err != nil { - return nil, errors.WithMessage(err, "failed to create security config from configuration") + return nil, fmt.Errorf("failed to create security config from configuration: %w", err) } execHelper := hexec.New(securityConfig) ps, err := helpers.NewPathSpec(fs, cfg.Language, logger) if err != nil { - return nil, errors.Wrap(err, "create PathSpec") + return nil, fmt.Errorf("create PathSpec: %w", err) } fileCaches, err := filecache.NewCaches(ps) if err != nil { - return nil, errors.WithMessage(err, "failed to create file caches from configuration") + return nil, fmt.Errorf("failed to create file caches from configuration: %w", err) } errorHandler := &globalErrHandler{} |