Skip to content
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

Replace .Close() methods with value returned from New*() #30

Open
gebn opened this issue May 9, 2020 · 2 comments
Open

Replace .Close() methods with value returned from New*() #30

gebn opened this issue May 9, 2020 · 2 comments

Comments

@gebn
Copy link
Owner

gebn commented May 9, 2020

It's harder to forget to call .Close() when you are given a function explicitly when dialling a BMC or creating a session.

machine, close, err := bmc.DialV2(...)
if err != nil {
    return err
}
defer close()  // not machine.Close()
...
@gebn
Copy link
Owner Author

gebn commented May 24, 2020

On the contrary, it does introduce another name into the scope.

@gebn
Copy link
Owner Author

gebn commented May 24, 2020

Needs to return the same type for Dial() and NewSession()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant