You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
373 B
14 lines
373 B
package service |
|
|
|
import ( |
|
"strings" |
|
"testing" |
|
) |
|
|
|
func TestSliceUnique(t *testing.T) { |
|
var slice1 = []string{"绘画", "哈哈", "22", "2223", "绘画"} |
|
t.Logf("unique : %v", SliceUnique(Slice2Interface(slice1))) |
|
tag := "绘画, 哈哈, 22, 2223, 绘画" |
|
t.Logf("unique : %v", strings.Join(Slice2String(SliceUnique(Slice2Interface(strings.Split(tag, ",")))), ",")) |
|
|
|
}
|
|
|