Przeglądaj źródła

Do not directly cast io.ReadSeeker to io.Reader

`golint` had the following issue when linting this file:

```
daemon/logger/jsonfilelog/read.go:116:10: should omit type io.Reader
from declaration of var rdr; it will be inferred from the right-hand
side
```

In order to keep it happy changing it to an indirect assignment will
still maintain the same functionality.

Signed-off-by: Tom Booth <tombooth@gmail.com>
Tom Booth 8 lat temu
rodzic
commit
6314bec641
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      daemon/logger/jsonfilelog/read.go

+ 2 - 1
daemon/logger/jsonfilelog/read.go

@@ -113,7 +113,8 @@ func (l *JSONFileLogger) readLogs(logWatcher *logger.LogWatcher, config logger.R
 }
 
 func tailFile(f io.ReadSeeker, logWatcher *logger.LogWatcher, tail int, since time.Time) {
-	var rdr io.Reader = f
+	var rdr io.Reader
+	rdr = f
 	if tail > 0 {
 		ls, err := tailfile.TailFile(f, tail)
 		if err != nil {