1234567891011121314151617181920212223 |
- package services
- import (
- "fmt"
- )
- type tracelog struct{}
- // 实现输出
- func (tracelog) Printf(format string, v ...interface{}) {
- fmt.Printf(format, v...)
- }
- func RemoveDuplicatesAndEmpty(a []string) (ret []string) {
- a_len := len(a)
- for i := 0; i < a_len; i++ {
- if (i > 0 && a[i-1] == a[i]) || len(a[i]) == 0 {
- continue
- }
- ret = append(ret, a[i])
- }
- return
- }
|