slice.go 189 B

123456789101112
  1. package util
  2. func TrimStringSlice(list []string) []string {
  3. var out []string
  4. for _, item := range list {
  5. if len(item) == 0 {
  6. continue
  7. }
  8. out = append(out, item)
  9. }
  10. return out
  11. }