文章目录 golang 中只有 map 的数据结构,没有直接提供 set 的数据结构,但是我们可以利用 map 来简单的实现 set func main() { // 切片 sli := []int{ 1, 2, 3, 4