aboutsummaryrefslogtreecommitdiffhomepage
path: root/source
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <[email protected]>2016-11-15 21:22:43 +0100
committerBjørn Erik Pedersen <[email protected]>2016-11-15 21:22:43 +0100
commit950034db5cca6df75a2cb39c5e2c2e66dc41c534 (patch)
treece8c79732372f6713da50d07d773f1b0035337a5 /source
parentbb36d57be5bafb61ae65a58b6ed61db122464151 (diff)
downloadhugo-950034db5cca6df75a2cb39c5e2c2e66dc41c534.tar.gz
hugo-950034db5cca6df75a2cb39c5e2c2e66dc41c534.zip
source, tpl: Fix staticcheck complaints
tpl/template_funcs.go:1019:3: the surrounding loop is unconditionally terminated source/lazy_file_reader.go:66:5: err != nil is always true for all possible values ([nil:error] != [nil:error])
Diffstat (limited to 'source')
-rw-r--r--source/lazy_file_reader.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/lazy_file_reader.go b/source/lazy_file_reader.go
index 8ebe8df21..7cc484f0b 100644
--- a/source/lazy_file_reader.go
+++ b/source/lazy_file_reader.go
@@ -62,8 +62,7 @@ func (l *LazyFileReader) Read(p []byte) (n int, err error) {
}
l.contents = bytes.NewReader(b)
}
- l.contents.Seek(l.pos, 0)
- if err != nil {
+ if _, err = l.contents.Seek(l.pos, 0); err != nil {
return 0, errors.New("failed to set read position: " + err.Error())
}
n, err = l.contents.Read(p)