Merge pull request #69 from MalloZup/Nitpick

Use Guardclause for function
This commit is contained in:
Noah Watkins 2018-10-09 10:24:23 -07:00 committed by GitHub
commit 21c4240aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -46,12 +46,11 @@ func (c *Conn) PingMonitor(id string) (string, error) {
// if any.
func (c *Conn) Connect() error {
ret := C.rados_connect(c.cluster)
if ret == 0 {
c.connected = true
return nil
} else {
if ret != 0 {
return RadosError(int(ret))
}
c.connected = true
return nil
}
// Shutdown disconnects from the cluster.