Эх сурвалжийг харах

pool: Remove channel nil assignation after declaration (#69)

Minor change to make the code more Go idiomatic, not needing to assign
nil to a channel which is just declared, because its default it's nil.
Ivan Fraixedes 6 жил өмнө
parent
commit
480bedc490
1 өөрчлөгдсөн 1 нэмэгдсэн , 3 устгасан
  1. 1 3
      pool.go

+ 1 - 3
pool.go

@@ -80,9 +80,7 @@ func (p *Pool) get(timeout time.Duration) *client {
 	}
 
 	var deadline <-chan time.Time
-	if timeout < 0 {
-		deadline = nil
-	} else {
+	if timeout >= 0 {
 		deadline = time.After(timeout)
 	}