Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareMaps ¶ added in v0.8.19
func CompareMaps[K Comparable, V Comparable](A, B map[K]V) (OnlyA, OnlyB, Unequal []K)
CompareMaps 使用泛型对比两个 map[K]V 类型的参数 A 和 B - K: map 的键,必须是可比较的类型 - V: map 的值,必须是可比较的类型 返回三个切片:OnlyA、OnlyB 和 Unequal - OnlyA: 仅在 A 中存在的键 - OnlyB: 仅在 B 中存在的键 - Unequal: 两边都存在,但值不相等的键
func CompareSlices ¶ added in v0.8.19
func CompareSlices[T Comparable](a, b []T) (OnlyA []T, OnlyB []T)
CompareSlices 使用泛型对比两个切片 A 和 B - T: 切片元素的类型,必须是可比较的类型 返回两个切片:OnlyA 和 OnlyB - OnlyA: 仅在 A 中存在的元素 - OnlyB: 仅在 B 中存在的元素
Types ¶
Click to show internal directories.
Click to hide internal directories.