Skip to content

Commit cc9e2f8

Browse files
authored
Add Equal method to preloadlist.Entry struct (#141)
1 parent 8b52744 commit cc9e2f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chromium/preloadlist/preloadlist.go

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ type Entry struct {
9494
Policy PolicyType `json:"policy"`
9595
}
9696

97+
// Equal checks if Entry e is equal to Entry e2 using == to compare all fields.
98+
func (e Entry) Equal(e2 Entry) bool {
99+
return e.Name == e2.Name && e.Mode == e2.Mode && e.IncludeSubDomains == e2.IncludeSubDomains && e.Policy == e2.Policy
100+
}
101+
97102
// IndexedEntries is case-insensitive index of
98103
// the entries from the given PreloadList.
99104
type IndexedEntries struct {

0 commit comments

Comments
 (0)