Replace .Close() methods with value returned from New*()
gebn opened this issue · 2 comments
gebn commented
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 commented
On the contrary, it does introduce another name into the scope.
gebn commented
Needs to return the same type for Dial()
and NewSession()