Use fsx package and friends from pkglib
This commit is contained in:
parent
1f8c55da7c
commit
0f6803f890
35 changed files with 91 additions and 493 deletions
|
|
@ -1,15 +1,15 @@
|
|||
package validators
|
||||
|
||||
import (
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/fsx"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tkw1536/pkglib/fsx"
|
||||
)
|
||||
|
||||
func ValidateFile(path *string, dflt string) error {
|
||||
if *path == "" {
|
||||
*path = dflt
|
||||
}
|
||||
if !fsx.IsFile(*path) {
|
||||
if !fsx.IsRegular(*path) {
|
||||
return errors.Errorf("%q does not exist or is not a file", *path)
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue