-
Notifications
You must be signed in to change notification settings - Fork 2k
cli/connhelper/ssh: add NewSpec utility to prevent parsing URL twice #6034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6034 +/- ##
==========================================
- Coverage 58.91% 58.91% -0.01%
==========================================
Files 358 358
Lines 29983 29988 +5
==========================================
+ Hits 17664 17666 +2
- Misses 11339 11341 +2
- Partials 980 981 +1 🚀 New features to boost your workflow:
|
Ah, looks like I missed some changes from the branch I created this in;
|
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This allows creating a spec from an existing url.URL Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function was parsing the same URL twice; first to detect the scheme, then again (through ssh.ParseURL) to construct a ssh.Spec. Change the function to use the URL that's parsed, and use ssh.NewSpec instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
b89f264
to
f105e96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thx! Let me bring this one in; I have some changes in some other branches that I need to dust off 😂. After that, we may be able to start considering moving this package to a separate module (but we probably should look if everything is in a shape we want it to be in for "separate module"). |
cli/connhelper/ssh: add NewSpec utility
This allows creating a spec from an existing url.URL
cli/connhelper: don't parse URL twice
This function was parsing the same URL twice; first to detect the
scheme, then again (through ssh.ParseURL) to construct a ssh.Spec.
Change the function to use the URL that's parsed, and use ssh.NewSpec
instead.
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)