diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2023-02-04 20:48:57 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2023-02-04 21:16:18 -0500 |
| commit | 6af93cd2bd89d38ade8d9384fe3798aed1a38a65 (patch) | |
| tree | 5a505a798217963cd8aa89e54767cd1a8d38feea /tmpl | |
| parent | 08d70cf321ffede08205594ae4e7633f944647da (diff) | |
Remove uses of pkg/errors
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'tmpl')
| -rw-r--r-- | tmpl/tmpl.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tmpl/tmpl.go b/tmpl/tmpl.go index 7021b72b..c4f6aefd 100644 --- a/tmpl/tmpl.go +++ b/tmpl/tmpl.go @@ -3,10 +3,9 @@ package tmpl import ( "bytes" + "fmt" "path/filepath" "text/template" - - "github.com/pkg/errors" ) // Template - @@ -68,7 +67,7 @@ func (t *Template) Exec(name string, tmplcontext ...interface{}) (string, error) } tmpl := t.root.Lookup(name) if tmpl == nil { - return "", errors.Errorf(`template "%s" not defined`, name) + return "", fmt.Errorf(`template "%s" not defined`, name) } return render(tmpl, ctx) } @@ -87,11 +86,11 @@ func (t *Template) parseArgs(args ...interface{}) (name, in string, ctx interfac ctx = t.defaultCtx if len(args) == 0 || len(args) > 3 { - return "", "", nil, errors.Errorf("wrong number of args for tpl: want 1, 2, or 3 - got %d", len(args)) + return "", "", nil, fmt.Errorf("wrong number of args for tpl: want 1, 2, or 3 - got %d", len(args)) } first, ok := args[0].(string) if !ok { - return "", "", nil, errors.Errorf("wrong input: first arg must be string, got %T", args[0]) + return "", "", nil, fmt.Errorf("wrong input: first arg must be string, got %T", args[0]) } switch len(args) { @@ -112,7 +111,7 @@ func (t *Template) parseArgs(args ...interface{}) (name, in string, ctx interfac var ok bool in, ok = args[1].(string) if !ok { - return "", "", nil, errors.Errorf("wrong input: second arg (in) must be string, got %T", args[0]) + return "", "", nil, fmt.Errorf("wrong input: second arg (in) must be string, got %T", args[0]) } ctx = args[2] } |
