Skip to content

Commit 60b433a

Browse files
kielbarrykaralabe
authored andcommitted
event: golint updates for this or self warning (ethereum#16631)
* event/*: golint updates for this or self warning * event/*: golint updates for this or self warning, pr updated per feedback
1 parent fd3da7c commit 60b433a

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

event/filter/filter.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -45,37 +45,37 @@ func New() *Filters {
4545
}
4646
}
4747

48-
func (self *Filters) Start() {
49-
go self.loop()
48+
func (f *Filters) Start() {
49+
go f.loop()
5050
}
5151

52-
func (self *Filters) Stop() {
53-
close(self.quit)
52+
func (f *Filters) Stop() {
53+
close(f.quit)
5454
}
5555

56-
func (self *Filters) Notify(filter Filter, data interface{}) {
57-
self.ch <- FilterEvent{filter, data}
56+
func (f *Filters) Notify(filter Filter, data interface{}) {
57+
f.ch <- FilterEvent{filter, data}
5858
}
5959

60-
func (self *Filters) Install(watcher Filter) int {
61-
self.watchers[self.id] = watcher
62-
self.id++
60+
func (f *Filters) Install(watcher Filter) int {
61+
f.watchers[f.id] = watcher
62+
f.id++
6363

64-
return self.id - 1
64+
return f.id - 1
6565
}
6666

67-
func (self *Filters) Uninstall(id int) {
68-
delete(self.watchers, id)
67+
func (f *Filters) Uninstall(id int) {
68+
delete(f.watchers, id)
6969
}
7070

71-
func (self *Filters) loop() {
71+
func (f *Filters) loop() {
7272
out:
7373
for {
7474
select {
75-
case <-self.quit:
75+
case <-f.quit:
7676
break out
77-
case event := <-self.ch:
78-
for _, watcher := range self.watchers {
77+
case event := <-f.ch:
78+
for _, watcher := range f.watchers {
7979
if reflect.TypeOf(watcher) == reflect.TypeOf(event.filter) {
8080
if watcher.Compare(event.filter) {
8181
watcher.Trigger(event.data)
@@ -86,10 +86,10 @@ out:
8686
}
8787
}
8888

89-
func (self *Filters) Match(a, b Filter) bool {
89+
func (f *Filters) Match(a, b Filter) bool {
9090
return reflect.TypeOf(a) == reflect.TypeOf(b) && a.Compare(b)
9191
}
9292

93-
func (self *Filters) Get(i int) Filter {
94-
return self.watchers[i]
93+
func (f *Filters) Get(i int) Filter {
94+
return f.watchers[i]
9595
}

0 commit comments

Comments
 (0)