diff --git a/goldsmith.go b/goldsmith.go index ab22320..b744a37 100644 --- a/goldsmith.go +++ b/goldsmith.go @@ -126,9 +126,9 @@ func (gs *goldsmith) referenceFile(path string) { func (gs *goldsmith) fault(f *file, err error) { gs.errorMtx.Lock() - ferr := &Error{err: err} + ferr := &Error{Err: err} if f != nil { - ferr.path = f.path + ferr.Path = f.path } gs.errors = append(gs.errors, ferr) gs.errorMtx.Unlock() diff --git a/types.go b/types.go index 1a59c31..e6eacd8 100644 --- a/types.go +++ b/types.go @@ -79,12 +79,12 @@ type Context interface { } type Error struct { - path string - err error + Err error + Path string } -func (e *Error) Error() string { - return e.err.Error() +func (e Error) Error() string { + return e.Err.Error() } type Initializer interface {