Fixed tautological conditions (#7959)

We already check for err being equal to nil above, no need
to check again.
master
Christian Muehlhaeuser 5 years ago committed by Harshavardhana
parent c5faba55c1
commit 38bc3a45db
  1. 2
      cmd/posix_test.go
  2. 9
      pkg/event/target/amqp.go

@ -1830,10 +1830,8 @@ func TestPosixVerifyFile(t *testing.T) {
if err == io.EOF {
break
}
if err != nil {
t.Fatal(err)
}
}
w.Close()
if err := posixStorage.VerifyFile(volName, fileName, false, algo, nil, shardSize); err != nil {
t.Fatal(err)

@ -163,13 +163,14 @@ func NewAMQPTarget(id string, args AMQPArgs) (*AMQPTarget, error) {
// Retry 5 times with time interval of 2 seconds.
for i := 1; i <= 5; i++ {
conn, err = amqp.Dial(args.URL.String())
if err == nil {
break
}
if err != nil && i == 5 {
if err != nil {
if i == 5 {
return nil, err
}
time.Sleep(2 * time.Second)
continue
}
break
}
return &AMQPTarget{

Loading…
Cancel
Save