Perhaps something like `strings.Count(strings.TrimSpace(s), "\n")+1`?