mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
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])
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
bb36d57be5
commit
950034db5c
@@ -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)
|
||||
|
Reference in New Issue
Block a user