bmc
bmc copied to clipboard
Replace .Close() methods with value returned from New*()
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()
...
On the contrary, it does introduce another name into the scope.
Needs to return the same type for Dial() and NewSession()