Skip to content

Commit 6a98d99

Browse files
committed
misc: improve styling of errs
Signed-off-by: Hidde Beydals <[email protected]>
1 parent 1e4b1a0 commit 6a98d99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/secret/secret.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func parseAuthMap(config dockerConfig) (map[string]authn.AuthConfig, error) {
201201

202202
func getURLHost(urlStr string) (string, error) {
203203
if urlStr == "http://" || urlStr == "https://" {
204-
return "", errors.New("Empty url")
204+
return "", errors.New("empty url")
205205
}
206206

207207
// ensure url has https:// or http:// prefix
@@ -220,9 +220,9 @@ func getURLHost(urlStr string) (string, error) {
220220
}
221221

222222
if u.Host == "" {
223-
return "", errors.New(fmt.Sprintf(
224-
"Invalid registry auth key: %s. Expected an HTTPS URL (e.g. 'https://index.docker.io/v2/' or 'https://index.docker.io'), or the same without the 'https://' (e.g., 'index.docker.io/v2/' or 'index.docker.io')",
225-
urlStr))
223+
return "", fmt.Errorf(
224+
"expected an HTTPS URL instead of '%s' (e.g. 'https://index.docker.io/v2/' or 'https://index.docker.io'), or the same without 'https://' (e.g., 'index.docker.io/v2/' or 'index.docker.io')",
225+
urlStr)
226226
}
227227

228228
return u.Host, nil

0 commit comments

Comments
 (0)