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