Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
authorAlbert Nigmatzianov <albertnigma@gmail.com>2016-11-15 23:22:43 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-15 23:22:43 +0300
commit950034db5cca6df75a2cb39c5e2c2e66dc41c534 (patch)
treece8c79732372f6713da50d07d773f1b0035337a5 /tpl
parentbb36d57be5bafb61ae65a58b6ed61db122464151 (diff)
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 'tpl')
-rw-r--r--tpl/template_funcs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go
index 281e5cd64..d9b4be990 100644
--- a/tpl/template_funcs.go
+++ b/tpl/template_funcs.go
@@ -1010,13 +1010,13 @@ func delimit(seq, delimiter interface{}, last ...interface{}) (template.HTML, er
}
var dLast *string
- for _, l := range last {
+ if len(last) > 0 {
+ l := last[0]
dStr, err := cast.ToStringE(l)
if err != nil {
dLast = nil
}
dLast = &dStr
- break
}
seqv := reflect.ValueOf(seq)