-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
current code results in panic and we certainly don't want that. #2286 (comment)
- Loading branch information
Showing
4 changed files
with
57 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
// Package errors contains errors that are thrown across packages. | ||
package errors | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
// // ErrPermissionsChanged occurs if the file permission have changed since the file was created. | ||
// type ErrPermissionsChanged struct { | ||
// name string | ||
// got, want os.FileMode | ||
// } | ||
|
||
// ErrPermissionsChanged occurs if the file permission have changed since the file was created. | ||
type ErrPermissionsChanged struct { | ||
name string | ||
got, want os.FileMode | ||
} | ||
// func NewErrPermissionsChanged(name string, got, want os.FileMode) *ErrPermissionsChanged { | ||
// return &ErrPermissionsChanged{name: name, got: got, want: want} | ||
// } | ||
|
||
func NewErrPermissionsChanged(name string, got, want os.FileMode) *ErrPermissionsChanged { | ||
return &ErrPermissionsChanged{name: name, got: got, want: want} | ||
} | ||
|
||
func (e ErrPermissionsChanged) Error() string { | ||
return fmt.Sprintf( | ||
"file: [%v]\nexpected file permissions: %v, got: %v", | ||
e.name, | ||
e.want, | ||
e.got, | ||
) | ||
} | ||
// func (e ErrPermissionsChanged) Error() string { | ||
// return fmt.Sprintf( | ||
// "file: [%v]\nexpected file permissions: %v, got: %v", | ||
// e.name, | ||
// e.want, | ||
// e.got, | ||
// ) | ||
// } |