From ec8c803b2751e912574ad4ff150b8d8268739467 Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Tue, 3 Dec 2019 15:29:17 -0500 Subject: [PATCH] verbs --- parser/decl.go | 2 +- parser/parser.go | 10 +++++----- parser/source.go | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/parser/decl.go b/parser/decl.go index 762806c..4dd6540 100644 --- a/parser/decl.go +++ b/parser/decl.go @@ -40,7 +40,7 @@ func (decls Decls) Files() ([]*File, error) { files, err := fl.Files(v) if err != nil { - return nil, fmt.Errorf("%w: %s", err, d) + return nil, fmt.Errorf("%s: %s", err, d) } for _, f := range files { diff --git a/parser/parser.go b/parser/parser.go index 4244b1c..cd6997d 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -100,19 +100,19 @@ func (p *Parser) ParseDir(abs string, mode parser.Mode) ([]*ParsedSource, error) her, err := here.Dir(abs) if err != nil { - return nil, fmt.Errorf("%w: here.Dir failed %s", err, abs) + return nil, fmt.Errorf("%s: here.Dir failed %s", err, abs) } pt, err := her.Parse(strings.TrimPrefix(abs, filepath.Dir(abs))) if err != nil { - return nil, fmt.Errorf("%w: here.Parse failed %s", err, abs) + return nil, fmt.Errorf("%s: here.Parse failed %s", err, abs) } fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, abs, nil, 0) if err != nil { - return nil, fmt.Errorf("%w: ParseDir failed %s", err, abs) + return nil, fmt.Errorf("%s: ParseDir failed %s", err, abs) } var srcs []*ParsedSource @@ -205,13 +205,13 @@ func (p *Parser) parse() error { srcs, err := p.ParseDir(path, 0) if err != nil { - return fmt.Errorf("%w: %s", err, path) + return fmt.Errorf("%s: %s", err, path) } for _, src := range srcs { mm, err := src.DeclsMap() if err != nil { - return fmt.Errorf("%w: %s", err, src.Abs) + return fmt.Errorf("%s: %s", err, src.Abs) } for k, v := range mm { p.decls[k] = append(p.decls[k], v...) diff --git a/parser/source.go b/parser/source.go index 02e2b8d..adab985 100644 --- a/parser/source.go +++ b/parser/source.go @@ -140,26 +140,26 @@ func (p *ParsedSource) parse() error { n := ce.Args[0] val, err := p.value(n) if err != nil { - p.err = fmt.Errorf("%w: %s", err, n) + p.err = fmt.Errorf("%s: %s", err, n) return false } info, err := here.Dir(filepath.Dir(p.Abs)) if err != nil { - p.err = fmt.Errorf("%w: %s", err, p.Abs) + p.err = fmt.Errorf("%s: %s", err, p.Abs) return false } pt, err := info.Parse(val) if err != nil { - p.err = fmt.Errorf("%w: %s", err, p.Abs) + p.err = fmt.Errorf("%s: %s", err, p.Abs) return false } if pt.Pkg != info.Module.Path { info, err = here.Package(pt.Pkg) if err != nil { - p.err = fmt.Errorf("%w: %s", err, p.Abs) + p.err = fmt.Errorf("%s: %s", err, p.Abs) return false } }