// rmDuplicate 数组去重 func rmDuplicate(list []string) []string { var x []string for _, i := range list { if len(x) == 0 { x = append(x, i) } else { for k, v := range x { if i == v { break } if k == len(x)-1 { x = append(x, i) } } } } return x }
标签:string,list,len,range,数组,go From: https://www.cnblogs.com/siyunianhua/p/16806755.html