mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-13 20:24:00 +02:00
deps: Fix most golint issues
deps/deps.go:79:6: exported type Listeners should have comment or be unexported deps/deps.go:86:1: exported method Listeners.Add should have comment or be unexported deps/deps.go:92:1: exported method Listeners.Notify should have comment or be unexported
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
daffeec30d
commit
a53f962312
3
deps/deps.go
vendored
3
deps/deps.go
vendored
@@ -76,6 +76,7 @@ type Deps struct {
|
|||||||
BuildStartListeners *Listeners
|
BuildStartListeners *Listeners
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Listeners represents an event listener.
|
||||||
type Listeners struct {
|
type Listeners struct {
|
||||||
sync.Mutex
|
sync.Mutex
|
||||||
|
|
||||||
@@ -83,12 +84,14 @@ type Listeners struct {
|
|||||||
listeners []func()
|
listeners []func()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add adds a function to a Listeners instance.
|
||||||
func (b *Listeners) Add(f func()) {
|
func (b *Listeners) Add(f func()) {
|
||||||
b.Lock()
|
b.Lock()
|
||||||
defer b.Unlock()
|
defer b.Unlock()
|
||||||
b.listeners = append(b.listeners, f)
|
b.listeners = append(b.listeners, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify executes all listener functions.
|
||||||
func (b *Listeners) Notify() {
|
func (b *Listeners) Notify() {
|
||||||
b.Lock()
|
b.Lock()
|
||||||
defer b.Unlock()
|
defer b.Unlock()
|
||||||
|
Reference in New Issue
Block a user