I find myself implementing this function pretty often and I thought it would be decent addition to the standard library.
// Truncate returns the first n runes of s.
func Truncate(s string, n int) string {
if len(s) <= n {
return s
}
for i := range s {
if n == 0 {
return s[:i]
}
n--
}
return s
}