all: fix some comments

Change-Id: I15769c4302e8dd1d649e0eaa9b16099f0eda603b
Reviewed-on: https://go-review.googlesource.com/c/build/+/464239
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
diff --git a/buildlet/buildletclient.go b/buildlet/buildletclient.go
index 7a3362e..8c75a7c 100644
--- a/buildlet/buildletclient.go
+++ b/buildlet/buildletclient.go
@@ -60,7 +60,7 @@
 
 var ErrClosed = errors.New("buildlet: Client closed")
 
-// Closes destroys and closes down the buildlet, destroying all state
+// Close destroys and closes down the buildlet, destroying all state
 // immediately.
 func (c *client) Close() error {
 	// TODO(bradfitz): have a Client-wide Done channel we set on
diff --git a/cmd/buildlet/buildlet.go b/cmd/buildlet/buildlet.go
index 961aa3a..a3c137b 100644
--- a/cmd/buildlet/buildlet.go
+++ b/cmd/buildlet/buildlet.go
@@ -1027,7 +1027,7 @@
 	return filepath.Join(*workDir, relDir), nil
 }
 
-// needsBashWrappers reports whether the given command needs to
+// needsBashWrapper reports whether the given command needs to
 // run through bash.
 func needsBashWrapper(cmd string) bool {
 	if !strings.HasSuffix(cmd, ".bash") {
diff --git a/cmd/coordinator/internal/dashboard/handler.go b/cmd/coordinator/internal/dashboard/handler.go
index e41b5ea..ca37f9d 100644
--- a/cmd/coordinator/internal/dashboard/handler.go
+++ b/cmd/coordinator/internal/dashboard/handler.go
@@ -225,7 +225,7 @@
 	User       string
 }
 
-// shortUser returns a shortened version of a user string.
+// ShortUser returns a shortened version of a user string.
 func (c *commit) ShortUser() string {
 	user := c.User
 	if i, j := strings.Index(user, "<"), strings.Index(user, ">"); 0 <= i && i < j {
diff --git a/cmd/coordinator/internal/legacydash/build.go b/cmd/coordinator/internal/legacydash/build.go
index 4a540cd..76bbd36 100644
--- a/cmd/coordinator/internal/legacydash/build.go
+++ b/cmd/coordinator/internal/legacydash/build.go
@@ -198,7 +198,7 @@
 	return nil
 }
 
-// removeResult removes the denormalized Result data from the ResultData field
+// RemoveResult removes the denormalized Result data from the ResultData field
 // for the given builder and go hash.
 // It must be called from within the datastore transaction that gets and puts
 // the Commit. Note this is slightly different to AddResult, above.
diff --git a/cmd/coordinator/metrics.go b/cmd/coordinator/metrics.go
index e564ed0..d3a1a26 100644
--- a/cmd/coordinator/metrics.go
+++ b/cmd/coordinator/metrics.go
@@ -110,7 +110,7 @@
 	}
 }
 
-// recordRDPCount records the use of the gomote RDP functionality and sends it
+// recordGomoteRDPUsage records the use of the gomote RDP functionality and sends it
 // to the configured metrics backend.
 func recordGomoteRDPUsage(ctx context.Context) {
 	stats.Record(ctx, mGomoteRDPCount.M(1))
diff --git a/cmd/gerritbot/gerritbot.go b/cmd/gerritbot/gerritbot.go
index 490e003..690b966 100644
--- a/cmd/gerritbot/gerritbot.go
+++ b/cmd/gerritbot/gerritbot.go
@@ -380,7 +380,7 @@
 	return false, nil
 }
 
-// prShortLink returns text referencing an Issue or Pull Request that will be
+// githubShortLink returns text referencing an Issue or Pull Request that will be
 // automatically converted into a link by GitHub.
 func githubShortLink(owner, repo string, number int) string {
 	return fmt.Sprintf("%s#%d", owner+"/"+repo, number)
diff --git a/cmd/gitmirror/gitmirror.go b/cmd/gitmirror/gitmirror.go
index e65b008..da878ea 100644
--- a/cmd/gitmirror/gitmirror.go
+++ b/cmd/gitmirror/gitmirror.go
@@ -715,7 +715,7 @@
 // See runCmdContextLinux.
 var runCmdContext = runCmdContextDefault
 
-// runCommandContextDefault runs cmd controlled by ctx.
+// runCmdContextDefault runs cmd controlled by ctx.
 func runCmdContextDefault(ctx context.Context, cmd *exec.Cmd) error {
 	if err := cmd.Start(); err != nil {
 		return err
diff --git a/cmd/gitmirror/gitmirror_linux.go b/cmd/gitmirror/gitmirror_linux.go
index 16ba2f9..7b8f896 100644
--- a/cmd/gitmirror/gitmirror_linux.go
+++ b/cmd/gitmirror/gitmirror_linux.go
@@ -17,7 +17,7 @@
 	runCmdContext = runCmdContextLinux
 }
 
-// runCommandContext runs cmd controlled by ctx, killing it and all its
+// runCmdContextLinux runs cmd controlled by ctx, killing it and all its
 // children if necessary. cmd.SysProcAttr must be unset.
 func runCmdContextLinux(ctx context.Context, cmd *exec.Cmd) error {
 	if cmd.SysProcAttr != nil {
diff --git a/cmd/gopherbot/gopherbot.go b/cmd/gopherbot/gopherbot.go
index b3a44c2..680ebcf 100644
--- a/cmd/gopherbot/gopherbot.go
+++ b/cmd/gopherbot/gopherbot.go
@@ -609,7 +609,7 @@
 	return labels, nil
 }
 
-// removeLabelForIssue removes the given label from the given repo with the
+// removeLabelFromIssue removes the given label from the given repo with the
 // given issueNum. If the issue did not have the label already (or the label
 // didn't exist), return nil.
 func removeLabelFromIssue(ctx context.Context, repoID maintner.GitHubRepoID, issues issuesService, issueNum int, label string) error {
@@ -1483,7 +1483,7 @@
 	`It's your first ever CL! Congrats, and thanks for sending!`,
 }
 
-// isSubectToFreeze returns true if a repository is subject to the release
+// isSubjectToFreeze returns true if a repository is subject to the release
 // freeze. x/ repos can be subject if they are vendored into golang/go.
 func isSubjectToFreeze(repo string) bool {
 	switch repo {
diff --git a/cmd/pubsubhelper/github.go b/cmd/pubsubhelper/github.go
index f4191a0..48506a0 100644
--- a/cmd/pubsubhelper/github.go
+++ b/cmd/pubsubhelper/github.go
@@ -74,7 +74,7 @@
 	})
 }
 
-// validate compares the signature in the request header with the body.
+// validateGithubRequest compares the signature in the request header with the body.
 func validateGithubRequest(w http.ResponseWriter, r *http.Request) (body []byte, err error) {
 	// Decode signature header.
 	sigHeader := r.Header.Get("X-Hub-Signature")
diff --git a/cmd/securitybot/main.go b/cmd/securitybot/main.go
index a8ff356..8d5fbe9 100644
--- a/cmd/securitybot/main.go
+++ b/cmd/securitybot/main.go
@@ -429,7 +429,7 @@
 	return nil
 }
 
-// findCharges queries a gerrit instance for changes which should be tested, returning a
+// findChanges queries a gerrit instance for changes which should be tested, returning a
 // slice of revisions for each change.
 func (t *tester) findChanges(ctx context.Context) ([]*gerrit.ChangeInfo, error) {
 	return t.gerrit.QueryChanges(
diff --git a/devapp/owners/table.go b/devapp/owners/table.go
index 3bae60d..95a1db6 100644
--- a/devapp/owners/table.go
+++ b/devapp/owners/table.go
@@ -16,7 +16,7 @@
 	return Owner{GitHubUsername: githubUsername, GerritEmail: p.Gerrit}
 }
 
-// archOsTeamn returns the *Entry for an architecture or OS team at github
+// archOsTeam returns the *Entry for an architecture or OS team at github
 func archOsTeam(teamName string) *Entry {
 	return &Entry{Primary: []Owner{gh("golang/" + teamName)}}
 }
diff --git a/internal/buildgo/buildgo.go b/internal/buildgo/buildgo.go
index 6447805..d439886 100644
--- a/internal/buildgo/buildgo.go
+++ b/internal/buildgo/buildgo.go
@@ -66,7 +66,7 @@
 
 var TestHookSnapshotExists func(*BuilderRev) bool
 
-// snapshotExists reports whether the snapshot exists in storage.
+// SnapshotExists reports whether the snapshot exists in storage.
 // It returns potentially false negatives on network errors.
 // Callers must not depend on this as more than an optimization.
 func (br *BuilderRev) SnapshotExists(ctx context.Context, buildEnv *buildenv.Environment) bool {
diff --git a/internal/cloud/fake_aws.go b/internal/cloud/fake_aws.go
index 9f7aa9e..d63059f 100644
--- a/internal/cloud/fake_aws.go
+++ b/internal/cloud/fake_aws.go
@@ -83,7 +83,7 @@
 	return instances, nil
 }
 
-// InstanceTypesArm retrieves all EC2 instance types in a region which support the ARM64 architecture.
+// InstanceTypesARM retrieves all EC2 instance types in a region which support the ARM64 architecture.
 func (f *FakeAWSClient) InstanceTypesARM(ctx context.Context) ([]*InstanceType, error) {
 	if ctx == nil {
 		return nil, errors.New("invalid params")
diff --git a/internal/coordinator/pool/reverse.go b/internal/coordinator/pool/reverse.go
index 7645483..be54b35 100644
--- a/internal/coordinator/pool/reverse.go
+++ b/internal/coordinator/pool/reverse.go
@@ -620,7 +620,7 @@
 	return ti < tj
 }
 
-// builderrKey generates the builder key used by reverse builders
+// builderKey generates the builder key used by reverse builders
 // to authenticate with the coordinator.
 func builderKey(builder string) string {
 	if len(builderMasterKey) == 0 {
diff --git a/internal/coordinator/remote/remote.go b/internal/coordinator/remote/remote.go
index 54cf354..313c936 100644
--- a/internal/coordinator/remote/remote.go
+++ b/internal/coordinator/remote/remote.go
@@ -201,7 +201,7 @@
 	return nil, fmt.Errorf("remote buildlet does not exist=%s", buildletName)
 }
 
-// Buildlet returns the buildlet client associated with the Session.
+// BuildletClient returns the buildlet client associated with the Session.
 func (sp *SessionPool) BuildletClient(buildletName string) (buildlet.Client, error) {
 	sp.mu.RLock()
 	defer sp.mu.RUnlock()
diff --git a/kubernetes/client.go b/kubernetes/client.go
index d52e4c6..3608d7c 100644
--- a/kubernetes/client.go
+++ b/kubernetes/client.go
@@ -212,7 +212,7 @@
 	return list.Items, nil
 }
 
-// PodDelete deletes the specified Kubernetes pod.
+// DeletePod deletes the specified Kubernetes pod.
 func (c *Client) DeletePod(ctx context.Context, podName string) error {
 	url := c.nsEndpoint() + "pods/" + podName
 	req, err := http.NewRequest("DELETE", url, strings.NewReader(`{"gracePeriodSeconds":0}`))
@@ -429,7 +429,7 @@
 	return string(body), nil
 }
 
-// PodNodes returns the list of nodes that comprise the Kubernetes cluster
+// GetNodes returns the list of nodes that comprise the Kubernetes cluster
 func (c *Client) GetNodes(ctx context.Context) ([]api.Node, error) {
 	var list api.NodeList
 	if err := c.do(ctx, "GET", c.endpointURL+"/nodes", &list); err != nil {
diff --git a/maintner/github.go b/maintner/github.go
index 1684d78..e90768d 100644
--- a/maintner/github.go
+++ b/maintner/github.go
@@ -776,7 +776,7 @@
 	}
 }
 
-// GitHubLimiter sets a limiter that controls the rate of requests made
+// SetGitHubLimiter sets a limiter that controls the rate of requests made
 // to GitHub APIs. If nil, requests are not limited. Only valid in leader mode.
 // The limiter must only be set before Sync or SyncLoop is called.
 func (c *Corpus) SetGitHubLimiter(l *rate.Limiter) {
@@ -1693,7 +1693,7 @@
 	return its, res, err
 }
 
-// foreach walks over all pages of items from getPage and calls fn for each item.
+// foreachItem walks over all pages of items from getPage and calls fn for each item.
 // If the first page's response was cached, fn is never called.
 func (p *githubRepoPoller) foreachItem(
 	ctx context.Context,