package html_components import "fmt" func ShortenLongText(text string) string { length := 50 if len(text) > length { return fmt.Sprint(text[0:length], "...") } return text }