summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCameron Moore <[email protected]>2018-09-06 13:23:56 -0500
committerBjørn Erik Pedersen <[email protected]>2018-09-07 08:25:51 +0200
commita53f962312e273cea9fe460b40655350a82210f2 (patch)
tree2d025f89767b2a2946d1974181fc6f8aa43738bb
parentdaffeec30d9d67017ec84064e15fd946b0b0cb0d (diff)
downloadhugo-a53f962312e273cea9fe460b40655350a82210f2.tar.gz
hugo-a53f962312e273cea9fe460b40655350a82210f2.zip
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
-rw-r--r--deps/deps.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/deps/deps.go b/deps/deps.go
index 3eecffca2..2b66a153f 100644
--- a/deps/deps.go
+++ b/deps/deps.go
@@ -76,6 +76,7 @@ type Deps struct {
BuildStartListeners *Listeners
}
+// Listeners represents an event listener.
type Listeners struct {
sync.Mutex
@@ -83,12 +84,14 @@ type Listeners struct {
listeners []func()
}
+// Add adds a function to a Listeners instance.
func (b *Listeners) Add(f func()) {
b.Lock()
defer b.Unlock()
b.listeners = append(b.listeners, f)
}
+// Notify executes all listener functions.
func (b *Listeners) Notify() {
b.Lock()
defer b.Unlock()