You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
602 B

  1. // Package errors contains errors that are thrown across packages.
  2. package errors
  3. import (
  4. "fmt"
  5. "os"
  6. )
  7. // ErrPermissionsChanged occurs if the file permission have changed since the file was created.
  8. type ErrPermissionsChanged struct {
  9. name string
  10. got, want os.FileMode
  11. }
  12. func NewErrPermissionsChanged(name string, got, want os.FileMode) *ErrPermissionsChanged {
  13. return &ErrPermissionsChanged{name: name, got: got, want: want}
  14. }
  15. func (e ErrPermissionsChanged) Error() string {
  16. return fmt.Sprintf(
  17. "file: [%v]\nexpected file permissions: %v, got: %v",
  18. e.name,
  19. e.want,
  20. e.got,
  21. )
  22. }