MCPcopy Create free account
hub / github.com/1Password/for-open-source / errSliceEqual

Function errSliceEqual

script/testing.go:206–233  ·  view source on GitHub ↗
(a, b []error)

Source from the content-addressed store, hash-verified

204}
205
206func errSliceEqual(a, b []error) bool {
207 if len(a) != len(b) {
208 return false
209 }
210
211 countA := make(map[string]int)
212 countB := make(map[string]int)
213
214 for _, err := range a {
215 countA[err.Error()]++
216 }
217
218 for _, err := range b {
219 countB[err.Error()]++
220 }
221
222 if len(countA) != len(countB) {
223 return false
224 }
225
226 for k, v := range countA {
227 if countB[k] != v {
228 return false
229 }
230 }
231
232 return true
233}

Callers 1

TestApplication_ParseFunction · 0.85

Calls 1

ErrorMethod · 0.80

Tested by 1

TestApplication_ParseFunction · 0.68