refactor!: rename Open()->NewSession() #124
No reviewers
Labels
No labels
breaking-change
bug
dependencies
duplicate
enhancement
go
good first issue
help wanted
invalid
investigation
proposal
proposal-accepted
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nemith/netconf!124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "brb/push-mkkpupxvlynw"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I plan on adding the idea of a SessionManager or a Pool which will allow a way to add retries, reconnections and potentially even multiple connections. This means
Open()isn't a great function name andNewSession()describes what it does a lot better.So while we are breaking changes lets make that change now to lock in a stable API sooner than later. This inches us closer to 1.0.0 release.
Pull request overview
This PR performs a breaking API change by renaming the
Open()function toNewSession()to better describe its purpose and prepare for future SessionManager/Pool features. This change brings the library closer to a stable 1.0.0 release.Key changes:
Open()toNewSession()insession.goReviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
Open()toNewSession()with updated documentationOpen()toNewSession()NewSession()NewSession()NewSession()💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -146,9 +146,9 @@ func newSession(transport transport.Transport, opts ...SessionOption) *Session {return sThere is a typo in the function documentation. "th=e" should be "the" (remove the equals sign).
@ -186,3 +186,3 @@}func TestOpenSuccess(t *testing.T) {func TestNewSessionSuccess(t *testing.T) {The test function name should be updated to reflect the renamed function. Consider renaming this to
TestNewSessionSuccessto maintain consistency with the API change fromOpen()toNewSession().The test function name should be updated to reflect the renamed function. Consider renaming this to
TestNewSessionHandshakeFailureto maintain consistency with the API change fromOpen()toNewSession().Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -148,3 +148,3 @@// Open will create a new Session with th=e given transport and open it with the// NewSession will create a new Session with the given transport and open it with the// necessary hello messages.There is a typo in the documentation comment. The text "th=e" should be "the".