diff --git a/goldsmith.go b/goldsmith.go index 98f0962..ab22320 100644 --- a/goldsmith.go +++ b/goldsmith.go @@ -126,7 +126,11 @@ func (gs *goldsmith) referenceFile(path string) { func (gs *goldsmith) fault(f *file, err error) { gs.errorMtx.Lock() - gs.errors = append(gs.errors, &Error{f, err}) + ferr := &Error{err: err} + if f != nil { + ferr.path = f.path + } + gs.errors = append(gs.errors, ferr) gs.errorMtx.Unlock() } diff --git a/types.go b/types.go index 2e2bcfe..1a59c31 100644 --- a/types.go +++ b/types.go @@ -79,7 +79,7 @@ type Context interface { } type Error struct { - file File + path string err error }