Преглед на файлове

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 години
родител
ревизия
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)
 	}