Skip to content

Instantly share code, notes, and snippets.

@tomtsang
Created February 11, 2018 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomtsang/d2ecfeb1502bc1eef0cfb09eedeeaecc to your computer and use it in GitHub Desktop.
Save tomtsang/d2ecfeb1502bc1eef0cfb09eedeeaecc to your computer and use it in GitHub Desktop.
path-error.go
// PathError records an error and the operation and file path that caused it.
type PathError struct {
Op string // "open", "unlink", etc.
Path string // The associated file.
Err error // Returned by the system call.
}
func (e *PathError) String() string {
return e.Op + " " + e.Path + ": "+ e.Err.Error()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment