From 9bf9e2f2ef6e8939a005c299c85c425a7be17857 Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Tue, 6 Jun 2023 16:08:20 -0400 Subject: [PATCH] Cleaning up more error handling --- cmd/obp/cmd/validate.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/obp/cmd/validate.go b/cmd/obp/cmd/validate.go index 6392a0c..5f0a5e0 100644 --- a/cmd/obp/cmd/validate.go +++ b/cmd/obp/cmd/validate.go @@ -26,10 +26,6 @@ var validateCmd = &cobra.Command{ // Uncomment the following line if your bare application // has an action associated with it: PreRunE: func(cmd *cobra.Command, args []string) error { - schemaURL := cmd.Flag("schema").Value.String() - if len(schemaURL) == 0 { - return fmt.Errorf("Please profide a schema filename") - } target := cmd.Flag("target").Value.String() if len(target) == 0 { return fmt.Errorf("Please profide a target filename") @@ -37,7 +33,7 @@ var validateCmd = &cobra.Command{ root := os.DirFS(target) _, err := root.Open(".") if err != nil { - return fmt.Errorf("cannot open target directory %q: %w", target, err) + return fmt.Errorf("cannot open provided vault root %q: %w", target, err) } return nil },