Static errors
This commit is contained in:
parent
e016e7112d
commit
a32d1d0f2a
|
@ -1,6 +1,7 @@
|
||||||
package plugin
|
package plugin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -193,14 +194,14 @@ func getSecretFileCmdArg(kvp string) (string, error) {
|
||||||
func getSecretCmdArg(kvp string, file bool) (string, error) {
|
func getSecretCmdArg(kvp string, file bool) (string, error) {
|
||||||
delimIndex := strings.IndexByte(kvp, '=')
|
delimIndex := strings.IndexByte(kvp, '=')
|
||||||
if delimIndex == -1 {
|
if delimIndex == -1 {
|
||||||
return "", fmt.Errorf("%s is not a valid secret", kvp)
|
return "", errors.New("invalid secret")
|
||||||
}
|
}
|
||||||
|
|
||||||
key := kvp[:delimIndex]
|
key := kvp[:delimIndex]
|
||||||
value := kvp[delimIndex+1:]
|
value := kvp[delimIndex+1:]
|
||||||
|
|
||||||
if key == "" || value == "" {
|
if key == "" || value == "" {
|
||||||
return "", fmt.Errorf("%s is not a valid secret", kvp)
|
return "", errors.New("invalid secret")
|
||||||
}
|
}
|
||||||
|
|
||||||
if file {
|
if file {
|
||||||
|
|
Loading…
Reference in New Issue