Name return values to prevent the need (and unnecessary code bloat) (#4576)

This is done to explicitly instantiate objects for every return statement.
This commit is contained in:
Frank Wessels
2017-06-21 19:53:09 -07:00
committed by Harshavardhana
parent cec8b238f3
commit 46897b1100
24 changed files with 304 additions and 306 deletions
+3 -3
View File
@@ -59,13 +59,13 @@ type amqpConn struct {
// dialAMQP - dials and returns an amqpConnection instance,
// for sending notifications. Returns error if amqp logger
// is not enabled.
func dialAMQP(amqpL amqpNotify) (amqpConn, error) {
func dialAMQP(amqpL amqpNotify) (ac amqpConn, e error) {
if !amqpL.Enable {
return amqpConn{}, errNotifyNotEnabled
return ac, errNotifyNotEnabled
}
conn, err := amqp.Dial(amqpL.URL)
if err != nil {
return amqpConn{}, err
return ac, err
}
return amqpConn{Connection: conn, params: amqpL}, nil
}