summaryrefslogtreecommitdiffstats
path: root/tpl/strings
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-12-30 09:20:58 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-01-04 18:01:26 +0100
commite402d91ee199afcace8ae75da6c3587bb8089ace (patch)
treea0f51de9707ed03aa1a3d7a9195fd9d0fceab108 /tpl/strings
parent3c51625c7152abca7e035fae15fc6807ca21cc86 (diff)
Misc doc, code refactoring to improve documentation
Diffstat (limited to 'tpl/strings')
-rw-r--r--tpl/strings/truncate.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/tpl/strings/truncate.go b/tpl/strings/truncate.go
index dd6267280..e8da7b84b 100644
--- a/tpl/strings/truncate.go
+++ b/tpl/strings/truncate.go
@@ -39,9 +39,9 @@ type htmlTag struct {
openTag bool
}
-// Truncate truncates a given string to the specified length.
-func (ns *Namespace) Truncate(a any, options ...any) (template.HTML, error) {
- length, err := cast.ToIntE(a)
+// Truncate truncates the string in s to the specified length.
+func (ns *Namespace) Truncate(s any, options ...any) (template.HTML, error) {
+ length, err := cast.ToIntE(s)
if err != nil {
return "", err
}