Skip to content

Commit

Permalink
simplify PathKind validate function
Browse files Browse the repository at this point in the history
  • Loading branch information
dobsonj committed Apr 30, 2021
1 parent 2000365 commit 8e3f193
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/sanity/sanity.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,12 @@ const (
)

func (pk PathKind) validate() error {
var err error = nil
switch pk {
case PathIsFile:
case PathIsDir:
case PathIsNotFound:
case PathIsOther:
case PathIsFile, PathIsDir, PathIsNotFound, PathIsOther:
return nil
default:
err = fmt.Errorf("invalid PathType: %s", pk)
return fmt.Errorf("invalid PathType: %s", pk)
}
return err
}

// defaultCheckPath runs os.Stat against the provided path and returns
Expand Down

0 comments on commit 8e3f193

Please sign in to comment.