We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Refs evcc-io/evcc#17446 (comment)
In
// Disconnect the client func (c *Client) Disconnect() error { c.isAuthenticated = false c.isConnected = false // -> THIS BLOCK CAN NEVER EXECUTE if c.isConnected && c.conn != nil { if err := c.conn.Close(); err != nil { return err } } Log.Info("disconnected") return nil }
The text was updated successfully, but these errors were encountered:
Instead of isConnected, wouldn't it be simpler to use c.conn == nil for this purpose? Disconnect would then become:
isConnected
c.conn == nil
// Disconnect the client func (c *Client) Disconnect() (err error) { c.isAuthenticated = false if c.conn != nil { err = c.conn.Close() c.conn = nil Log.Info("disconnected") } return err }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Refs evcc-io/evcc#17446 (comment)
In
The text was updated successfully, but these errors were encountered: