elasticsearch.go 376 B

1234567891011121314151617181920212223
  1. package services
  2. import (
  3. "fmt"
  4. )
  5. type tracelog struct{}
  6. // 实现输出
  7. func (tracelog) Printf(format string, v ...interface{}) {
  8. fmt.Printf(format, v...)
  9. }
  10. func RemoveDuplicatesAndEmpty(a []string) (ret []string) {
  11. a_len := len(a)
  12. for i := 0; i < a_len; i++ {
  13. if (i > 0 && a[i-1] == a[i]) || len(a[i]) == 0 {
  14. continue
  15. }
  16. ret = append(ret, a[i])
  17. }
  18. return
  19. }