~handlerug/handlebot

ref: e2138e35984f582b50a481b58c332afae2841b1f handlebot/utils.go -rw-r--r-- 130 bytes
e2138e35Umar Getagazov urlpreview: Parse Content-Disposition 3 months ago
                                                                                
1
2
3
4
5
6
7
8
package main

func ellipsize(text string, max int) string {
	if len(text) > max {
		return text[:max-3] + "..."
	}
	return text
}