mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Unify Godoc formatting, fix various typos
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
This commit is contained in:
@@ -91,7 +91,7 @@ type Accessor interface {
|
||||
MergedState() interface{}
|
||||
}
|
||||
|
||||
// AccessorFunc implements the Accessor interface
|
||||
// AccessorFunc implements the Accessor interface.
|
||||
type AccessorFunc func() interface{}
|
||||
|
||||
func (f AccessorFunc) MergedState() interface{} {
|
||||
@@ -116,20 +116,20 @@ type Watcher struct {
|
||||
listeners []Listener
|
||||
}
|
||||
|
||||
// Register a set of listeners that support the Listener interface and
|
||||
// notify them on changes.
|
||||
// NewWatcher registers a set of listeners that support the Listener interface
|
||||
// and notify them on changes.
|
||||
func NewWatcher() *Watcher {
|
||||
return &Watcher{}
|
||||
}
|
||||
|
||||
// Register Listener to receive updates of changes.
|
||||
// Add registers listener to receive updates of changes.
|
||||
func (m *Watcher) Add(listener Listener) {
|
||||
m.listenerLock.Lock()
|
||||
defer m.listenerLock.Unlock()
|
||||
m.listeners = append(m.listeners, listener)
|
||||
}
|
||||
|
||||
// Notify all listeners
|
||||
// Notify notifies all listeners.
|
||||
func (m *Watcher) Notify(instance interface{}) {
|
||||
m.listenerLock.RLock()
|
||||
listeners := m.listeners
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// TestInterface is a simple interface providing Errorf, to make injection for
|
||||
// testing easier (insert 'yo dawg' meme here)
|
||||
// testing easier (insert 'yo dawg' meme here).
|
||||
type TestInterface interface {
|
||||
Errorf(format string, args ...interface{})
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func NewIntOrStringFromInt(val int) IntOrString {
|
||||
return IntOrString{Kind: IntstrInt, IntVal: val}
|
||||
}
|
||||
|
||||
// NewIntOrStringFromInt creates an IntOrString object with a string value.
|
||||
// NewIntOrStringFromString creates an IntOrString object with a string value.
|
||||
func NewIntOrStringFromString(val string) IntOrString {
|
||||
return IntOrString{Kind: IntstrString, StrVal: val}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user