In golang, is there a way to truncate text in an html template?
For example, I have the following in my template:
{{ range .SomeContent }} ....
str := "xxxx" n := 2 if len(str) > n { fmt.Println(str[:n]) }
lest say we need quarter of ascii string
str[:len(str)/4]