slice.go 255 B

12345678910111213
  1. package util
  2. // TrimStringSlice returns a copy slice without empty string item
  3. func TrimStringSlice(list []string) []string {
  4. var out []string
  5. for _, item := range list {
  6. if len(item) == 0 {
  7. continue
  8. }
  9. out = append(out, item)
  10. }
  11. return out
  12. }