mirror of
https://github.com/pgsty/minio.git
synced 2026-08-08 15:23:29 +03:00
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:
committed by
Harshavardhana
parent
cec8b238f3
commit
46897b1100
+3
-3
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user