Skip to content

Commit 348aae9

Browse files
authored
tpl/strings: Remove unnecessary error check
1 parent 61482cf commit 348aae9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎tpl/strings/truncate.go‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ func (ns *Namespace) Truncate(s any, options ...any) (template.HTML, error) {
6767
default:
6868
return "", errors.New("too many arguments passed to truncate")
6969
}
70-
if err != nil {
71-
return "", errors.New("text to truncate must be a string")
72-
}
70+
7371
text, err := cast.ToStringE(textParam)
7472
if err != nil {
7573
return "", errors.New("text must be a string")

0 commit comments

Comments
 (0)