treewide: documentation on exported functions should start with their name
Change-Id: Iea3e929bed743d7edfbf5b54bbaa31796aeaaadd
Reviewed-on: https://review.monogon.dev/c/monogon/+/3027
Vouch-Run-CI: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/core/curator/bootstrap.go b/metropolis/node/core/curator/bootstrap.go
index 39c1100..ac2a4de 100644
--- a/metropolis/node/core/curator/bootstrap.go
+++ b/metropolis/node/core/curator/bootstrap.go
@@ -24,9 +24,9 @@
// However, that seems to not be worth the effort for a tightly coupled single
// consumer like the bootstrap code.
-// BootstrapFinish saves the given Node and initial cluster owner pubkey into
-// etcd, without regard for any other cluster state and directly using a given
-// etcd client.
+// BootstrapNodeFinish saves the given Node and initial cluster owner pubkey
+// into etcd, without regard for any other cluster state and directly using
+// a given etcd client.
//
// This is ran by the cluster bootstrap workflow to finish bootstrapping a
// cluster - afterwards, this cluster will be ready to serve.
diff --git a/metropolis/node/core/curator/watcher/watch_node.go b/metropolis/node/core/curator/watcher/watch_node.go
index f71940e..45c51ab 100644
--- a/metropolis/node/core/curator/watcher/watch_node.go
+++ b/metropolis/node/core/curator/watcher/watch_node.go
@@ -74,8 +74,8 @@
return true
}
-// Returns underlying error for this Watcher, nil if no error is present. After
-// an error is returned, the Watcher cannot be used anymore.
+// Error returns underlying error for this Watcher, nil if no error is present.
+// After an error is returned, the Watcher cannot be used anymore.
func (w *Watcher) Error() error {
return w.err
}
diff --git a/metropolis/node/core/identity/certificates.go b/metropolis/node/core/identity/certificates.go
index a8f2e7b..fca55b7 100644
--- a/metropolis/node/core/identity/certificates.go
+++ b/metropolis/node/core/identity/certificates.go
@@ -44,7 +44,7 @@
}
}
-// CA makes a Metropolis-compatible CA certificate template.
+// CACertificate makes a Metropolis-compatible CA certificate template.
//
// cn is a human-readable string that can be used to distinguish Metropolis
// clusters, if needed. It is not machine-parsed, instead only signature
diff --git a/metropolis/node/core/network/dhcp4c/dhcpc.go b/metropolis/node/core/network/dhcp4c/dhcpc.go
index 4aeeb3d..5159cc5 100644
--- a/metropolis/node/core/network/dhcp4c/dhcpc.go
+++ b/metropolis/node/core/network/dhcp4c/dhcpc.go
@@ -94,11 +94,11 @@
// was successfully received.
Send(payload *dhcpv4.DHCPv4) error
// SetReceiveDeadline sets a deadline for Receive() calls after which they
- // return with DeadlineExceededErr
+ // return with ErrDeadlineExceeded
SetReceiveDeadline(time.Time) error
// Receive waits for a DHCP message to arrive and returns it. If the
// deadline expires without a message arriving it will return
- // DeadlineExceededErr. If the message is completely malformed it will an
+ // ErrDeadlineExceeded. If the message is completely malformed it will an
// instance of InvalidMessageError.
Receive() (*dhcpv4.DHCPv4, error)
// Close closes the given transport. Calls to any of the above methods will
@@ -465,7 +465,7 @@
return s.ctx.Err()
default:
}
- if errors.Is(err, transport.DeadlineExceededErr) {
+ if errors.Is(err, transport.ErrDeadlineExceeded) {
return nil
}
var e transport.InvalidMessageError
diff --git a/metropolis/node/core/network/dhcp4c/dhcpc_test.go b/metropolis/node/core/network/dhcp4c/dhcpc_test.go
index 97c1b2b..7914b31 100644
--- a/metropolis/node/core/network/dhcp4c/dhcpc_test.go
+++ b/metropolis/node/core/network/dhcp4c/dhcpc_test.go
@@ -87,7 +87,7 @@
mt.receiveIdx++
return packet, nil
}
- return nil, transport.DeadlineExceededErr
+ return nil, transport.ErrDeadlineExceeded
}
func (mt *mockTransport) SetReceiveDeadline(t time.Time) error {
diff --git a/metropolis/node/core/network/dhcp4c/transport/transport.go b/metropolis/node/core/network/dhcp4c/transport/transport.go
index c3e6e0b..deed14d 100644
--- a/metropolis/node/core/network/dhcp4c/transport/transport.go
+++ b/metropolis/node/core/network/dhcp4c/transport/transport.go
@@ -24,7 +24,7 @@
"net"
)
-var DeadlineExceededErr = errors.New("deadline exceeded")
+var ErrDeadlineExceeded = errors.New("deadline exceeded")
func NewInvalidMessageError(internalErr error) error {
return &InvalidMessageError{internalErr: internalErr}
@@ -45,7 +45,7 @@
func deadlineFromTimeout(err error) error {
var timeoutErr net.Error
if errors.As(err, &timeoutErr) && timeoutErr.Timeout() {
- return DeadlineExceededErr
+ return ErrDeadlineExceeded
}
return err
}
diff --git a/metropolis/node/kubernetes/reconciler/reconciler.go b/metropolis/node/kubernetes/reconciler/reconciler.go
index f2c3838..2d2bfda 100644
--- a/metropolis/node/kubernetes/reconciler/reconciler.go
+++ b/metropolis/node/kubernetes/reconciler/reconciler.go
@@ -37,7 +37,7 @@
"source.monogon.dev/metropolis/pkg/supervisor"
)
-// Sad workaround for all the pointer booleans in K8s specs
+// True is a sad workaround for all the pointer booleans in K8s specs
func True() *bool {
val := true
return &val