MCPcopy Create free account
hub / github.com/OpenPrinting/goipp / Equal

Method Equal

attr.go:51–68  ·  view source on GitHub ↗

Equal checks that attrs and attrs2 are equal Note, Attributes(nil) and Attributes{} are not Equal but Similar.

(attrs2 Attributes)

Source from the content-addressed store, hash-verified

49//
50// Note, Attributes(nil) and Attributes{} are not Equal but Similar.
51func (attrs Attributes) Equal(attrs2 Attributes) bool {
52 if len(attrs) != len(attrs2) {
53 return false
54 }
55
56 if (attrs == nil) != (attrs2 == nil) {
57 return false
58 }
59
60 for i, attr := range attrs {
61 attr2 := attrs2[i]
62 if !attr.Equal(attr2) {
63 return false
64 }
65 }
66
67 return true
68}
69
70// Similar checks that attrs and attrs2 are **logically** equal,
71// which means the following:

Callers 1

Calls 1

EqualMethod · 0.45

Tested by 1