ValidateOutputPathFileMode validates the output paths of the "docker cp" command and serves as a helper to [ValidateOutputPath]
(fileMode os.FileMode)
| 87 | // ValidateOutputPathFileMode validates the output paths of the "docker cp" command |
| 88 | // and serves as a helper to [ValidateOutputPath] |
| 89 | func ValidateOutputPathFileMode(fileMode os.FileMode) error { |
| 90 | switch { |
| 91 | case fileMode&os.ModeDevice != 0: |
| 92 | return errors.New("got a device") |
| 93 | case fileMode&os.ModeIrregular != 0: |
| 94 | return errors.New("got an irregular file") |
| 95 | } |
| 96 | return nil |
| 97 | } |
| 98 | |
| 99 | func invalidParameter(err error) error { |
| 100 | return invalidParameterErr{err} |
no outgoing calls
no test coverage detected
searching dependent graphs…