From 6a98d99167186dd14bebe48e3a14c087c7e8c7c0 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 11 Oct 2023 15:17:30 +0200 Subject: [PATCH] misc: improve styling of errs Signed-off-by: Hidde Beydals --- internal/secret/secret.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/secret/secret.go b/internal/secret/secret.go index 1108e0cc..41e372a1 100644 --- a/internal/secret/secret.go +++ b/internal/secret/secret.go @@ -201,7 +201,7 @@ func parseAuthMap(config dockerConfig) (map[string]authn.AuthConfig, error) { func getURLHost(urlStr string) (string, error) { if urlStr == "http://" || urlStr == "https://" { - return "", errors.New("Empty url") + return "", errors.New("empty url") } // ensure url has https:// or http:// prefix @@ -220,9 +220,9 @@ func getURLHost(urlStr string) (string, error) { } if u.Host == "" { - return "", errors.New(fmt.Sprintf( - "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')", - urlStr)) + return "", fmt.Errorf( + "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')", + urlStr) } return u.Host, nil