mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05: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:
parent
daffeec30d
commit
a53f962312
1 changed files with 3 additions and 0 deletions
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()
|
||||||
|
|
Loading…
Reference in a new issue