mirror of
https://github.com/thegeeklab/drone-docker-buildx.git
synced 2024-11-16 01:20:39 +00:00
Static errors
This commit is contained in:
parent
e016e7112d
commit
a32d1d0f2a
@ -1,6 +1,7 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
@ -193,14 +194,14 @@ func getSecretFileCmdArg(kvp string) (string, error) {
|
||||
func getSecretCmdArg(kvp string, file bool) (string, error) {
|
||||
delimIndex := strings.IndexByte(kvp, '=')
|
||||
if delimIndex == -1 {
|
||||
return "", fmt.Errorf("%s is not a valid secret", kvp)
|
||||
return "", errors.New("invalid secret")
|
||||
}
|
||||
|
||||
key := kvp[:delimIndex]
|
||||
value := kvp[delimIndex+1:]
|
||||
|
||||
if key == "" || value == "" {
|
||||
return "", fmt.Errorf("%s is not a valid secret", kvp)
|
||||
return "", errors.New("invalid secret")
|
||||
}
|
||||
|
||||
if file {
|
||||
|
Loading…
Reference in New Issue
Block a user