Add missing error handling

It looks like these checks were just forgotten. Should we intentionally
ignore errors here, we should probably unassign err.
This commit is contained in:
Christian Muehlhaeuser 2020-10-01 08:57:04 +00:00
parent 0273362499
commit 1795d15837
2 changed files with 4 additions and 1 deletions

View File

@ -84,6 +84,9 @@ func (p *Parser) ParseFile(abs string, mode parser.Mode) (*ParsedSource, error)
} }
s.Path, err = s.Here.Parse(strings.TrimPrefix(abs, dir)) s.Path, err = s.Here.Parse(strings.TrimPrefix(abs, dir))
if err != nil {
return nil, err
}
return p.ParseSource(s, 0) return p.ParseSource(s, 0)
} }

View File

@ -57,5 +57,5 @@ func Stuff(w io.Writer, c here.Info, decls parser.Decls) error {
} }
_, err = w.Write(b) _, err = w.Write(b)
return nil return err
} }