Changing error def

This commit is contained in:
Alex Yatskov 2015-12-23 16:44:55 +09:00
parent caf9644d50
commit 0337ec8cbc
2 changed files with 6 additions and 2 deletions

View File

@ -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()
}

View File

@ -79,7 +79,7 @@ type Context interface {
}
type Error struct {
file File
path string
err error
}