Go中2个结构数组的元素明智比较的内置方法?
Inbuilt method for element wise comparison of 2 struct arrays in Go?
我有一个具有以下结构的结构,
//Number A struct that represents a new number to be addeded
type Number struct {
Country string `json:"country"`
Number string `json:"number"`
CreatedAt string `json:"created_at"`
}
并且我从 REST 调用中获取了此结构的响应数组,我需要进行逐元素比较。是否有任何内置方法来执行相同或更有效的方法而不是使用 for 循环并遍历元素?
Is there any inbuilt method to do the same or more efficient way to do it instead of using a for loop and iterating through the elements?
类型 Number
的值可以直接与 ==
进行比较。
我有一个具有以下结构的结构,
//Number A struct that represents a new number to be addeded
type Number struct {
Country string `json:"country"`
Number string `json:"number"`
CreatedAt string `json:"created_at"`
}
并且我从 REST 调用中获取了此结构的响应数组,我需要进行逐元素比较。是否有任何内置方法来执行相同或更有效的方法而不是使用 for 循环并遍历元素?
Is there any inbuilt method to do the same or more efficient way to do it instead of using a for loop and iterating through the elements?
类型 Number
的值可以直接与 ==
进行比较。