Skip to content
Snippets Groups Projects
Commit 518c888d authored by Angus Lees's avatar Angus Lees Committed by GitHub
Browse files

Prefer `fmt.Errorf` for generated error messages

parent b9b50f0a
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,6 @@ package cmd ...@@ -3,7 +3,6 @@ package cmd
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"errors"
goflag "flag" goflag "flag"
"fmt" "fmt"
"os" "os"
...@@ -87,7 +86,7 @@ func JsonnetVM(cmd *cobra.Command) (*jsonnet.VM, error) { ...@@ -87,7 +86,7 @@ func JsonnetVM(cmd *cobra.Command) (*jsonnet.VM, error) {
for _, extvar := range extvars { for _, extvar := range extvars {
kv := strings.SplitN(extvar, "=", 2) kv := strings.SplitN(extvar, "=", 2)
if len(kv) != 2 { if len(kv) != 2 {
return nil, errors.New("Failed to parse extvar: missing '=' in " + extvar) return nil, fmt.Errorf("Failed to parse extvar: missing '=' in %s", extvar)
} }
vm.ExtVar(kv[0], kv[1]) vm.ExtVar(kv[0], kv[1])
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment