From 0337ec8cbc294f924c3f9b793da918473c501eee Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 23 Dec 2015 16:44:55 +0900 Subject: [PATCH] Changing error def --- goldsmith.go | 6 +++++- types.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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 }