From 55073c404c0d44b9b63d1dbc033e9f6e0a1f3d2f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Apr 2025 14:27:49 +0200 Subject: [PATCH] cli/connhelper/ssh: tweak error-message (capitalize SSH) Signed-off-by: Sebastiaan van Stijn --- cli/connhelper/ssh/ssh.go | 4 ++-- cli/connhelper/ssh/ssh_test.go | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cli/connhelper/ssh/ssh.go b/cli/connhelper/ssh/ssh.go index a2552b82b5..94a46d5348 100644 --- a/cli/connhelper/ssh/ssh.go +++ b/cli/connhelper/ssh/ssh.go @@ -17,11 +17,11 @@ func ParseURL(daemonURL string) (*Spec, error) { if errors.As(err, &urlErr) { err = urlErr.Unwrap() } - return nil, fmt.Errorf("invalid ssh URL: %w", err) + return nil, fmt.Errorf("invalid SSH URL: %w", err) } s, err := newSpec(u) if err != nil { - return nil, fmt.Errorf("invalid ssh URL: %w", err) + return nil, fmt.Errorf("invalid SSH URL: %w", err) } return s, nil } diff --git a/cli/connhelper/ssh/ssh_test.go b/cli/connhelper/ssh/ssh_test.go index 198d5a0802..492408f116 100644 --- a/cli/connhelper/ssh/ssh_test.go +++ b/cli/connhelper/ssh/ssh_test.go @@ -87,41 +87,41 @@ func TestParseURL(t *testing.T) { { doc: "malformed URL", url: "malformed %%url", - expectedError: `invalid ssh URL: invalid URL escape "%%u"`, + expectedError: `invalid SSH URL: invalid URL escape "%%u"`, }, { doc: "URL missing scheme", url: "no-scheme.example.com", - expectedError: "invalid ssh URL: no scheme provided", + expectedError: "invalid SSH URL: no scheme provided", }, { doc: "invalid URL with password", url: "ssh://me:passw0rd@example.com", - expectedError: "invalid ssh URL: plain-text password is not supported", + expectedError: "invalid SSH URL: plain-text password is not supported", }, { doc: "invalid URL with query parameter", url: "ssh://example.com?foo=bar&bar=baz", - expectedError: `invalid ssh URL: query parameters are not allowed: "foo=bar&bar=baz"`, + expectedError: `invalid SSH URL: query parameters are not allowed: "foo=bar&bar=baz"`, }, { doc: "invalid URL with fragment", url: "ssh://example.com#bar", - expectedError: `invalid ssh URL: fragments are not allowed: "bar"`, + expectedError: `invalid SSH URL: fragments are not allowed: "bar"`, }, { doc: "invalid URL without hostname", url: "ssh://", - expectedError: "invalid ssh URL: hostname is empty", + expectedError: "invalid SSH URL: hostname is empty", }, { url: "ssh:///no-hostname", - expectedError: "invalid ssh URL: hostname is empty", + expectedError: "invalid SSH URL: hostname is empty", }, { doc: "invalid URL with unsupported scheme", url: "https://example.com", - expectedError: `invalid ssh URL: incorrect scheme: https`, + expectedError: `invalid SSH URL: incorrect scheme: https`, }, } for _, tc := range testCases {