mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
tpl/strings: Remove unnecessary error check
This commit is contained in:
@@ -67,9 +67,7 @@ func (ns *Namespace) Truncate(s any, options ...any) (template.HTML, error) {
|
||||
default:
|
||||
return "", errors.New("too many arguments passed to truncate")
|
||||
}
|
||||
if err != nil {
|
||||
return "", errors.New("text to truncate must be a string")
|
||||
}
|
||||
|
||||
text, err := cast.ToStringE(textParam)
|
||||
if err != nil {
|
||||
return "", errors.New("text must be a string")
|
||||
|
Reference in New Issue
Block a user