Skip to content

Commit 649f485

Browse files
cuishuanggopherbot
authored andcommitted
all: make function and struct comments match the names
Change-Id: Ia7d5c0bb0299d9d898e62740c3e05fc1e5cbf9cd Reviewed-on: https://go-review.googlesource.com/c/tools/+/639477 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent 26d1af2 commit 649f485

File tree

19 files changed

+24
-24
lines changed

19 files changed

+24
-24
lines changed

cmd/bisect/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ type Bisect struct {
262262
// each pattern starts with a !.
263263
Disable bool
264264

265-
// SkipDigits is the number of hex digits to use in skip messages.
265+
// SkipHexDigits is the number of hex digits to use in skip messages.
266266
// If the set of available changes is the same in each run, as it should be,
267267
// then this doesn't matter: we'll only exclude suffixes that uniquely identify
268268
// a given change. But for some programs, especially bisecting runtime

go/packages/packages_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3222,7 +3222,7 @@ func TestIssue70394(t *testing.T) {
32223222
}
32233223
}
32243224

3225-
// TestNeedTypesInfoOnly tests when NeedTypesInfo was set and NeedSyntax & NeedTypes were not,
3225+
// TestLoadTypesInfoWithoutSyntaxOrTypes tests when NeedTypesInfo was set and NeedSyntax & NeedTypes were not,
32263226
// Load should include the TypesInfo of packages properly
32273227
func TestLoadTypesInfoWithoutSyntaxOrTypes(t *testing.T) {
32283228
testAllOrModulesParallel(t, testLoadTypesInfoWithoutSyntaxOrTypes)

gopls/internal/cache/typerefs/pkggraph_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type Package struct {
4040
// transitively reachable through references, starting with the given decl.
4141
transitiveRefs map[string]*typerefs.PackageSet
4242

43-
// ReachesViaDeps records the set of packages in the containing graph whose
43+
// ReachesByDeps records the set of packages in the containing graph whose
4444
// syntax may affect the current package's types. See the package
4545
// documentation for more details of what this means.
4646
ReachesByDeps *typerefs.PackageSet

gopls/internal/golang/codeaction.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (req *codeActionsRequest) addCommandAction(cmd *protocol.Command, allowReso
172172
req.addAction(act)
173173
}
174174

175-
// addCommandAction adds an edit-based CodeAction to the result.
175+
// addEditAction adds an edit-based CodeAction to the result.
176176
func (req *codeActionsRequest) addEditAction(title string, fixedDiagnostics []protocol.Diagnostic, changes ...protocol.DocumentChange) {
177177
req.addAction(protocol.CodeAction{
178178
Title: title,
@@ -648,7 +648,7 @@ func refactorRewriteChangeQuote(ctx context.Context, req *codeActionsRequest) er
648648
return nil
649649
}
650650

651-
// refactorRewriteChangeQuote produces "Invert 'if' condition" code actions.
651+
// refactorRewriteInvertIf produces "Invert 'if' condition" code actions.
652652
// See [invertIfCondition] for command implementation.
653653
func refactorRewriteInvertIf(ctx context.Context, req *codeActionsRequest) error {
654654
if _, ok, _ := canInvertIfCondition(req.pgf.File, req.start, req.end); ok {

gopls/internal/golang/completion/postfix_snippets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type postfixTmplArgs struct {
6969
// Type is the type of "foo.bar" in "foo.bar.print!".
7070
Type types.Type
7171

72-
// FuncResult are results of the enclosed function
72+
// FuncResults are results of the enclosed function
7373
FuncResults []*types.Var
7474

7575
sel *ast.SelectorExpr

gopls/internal/golang/extract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ var conventionalVarNames = map[objKey]string{
16541654
{"http", "ResponseWriter"}: "rw", // Note: same as [AbbreviateVarName].
16551655
}
16561656

1657-
// varNameForTypeName chooses a "good" name for a variable with the given type,
1657+
// varNameForType chooses a "good" name for a variable with the given type,
16581658
// if possible. Otherwise, it returns "", false.
16591659
//
16601660
// For special types, it uses known conventional names.

gopls/internal/protocol/command/interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ type RunVulncheckResult struct {
525525
Token protocol.ProgressToken
526526
}
527527

528-
// GovulncheckResult holds the result of synchronously running the vulncheck
528+
// VulncheckResult holds the result of synchronously running the vulncheck
529529
// command.
530530
type VulncheckResult struct {
531531
// Result holds the result of running vulncheck.
@@ -695,7 +695,7 @@ type PackagesResult struct {
695695
// Packages is an unordered list of package metadata.
696696
Packages []Package
697697

698-
// Modules maps module path to module metadata for
698+
// Module maps module path to module metadata for
699699
// all the modules of the returned Packages.
700700
Module map[string]Module
701701
}

gopls/internal/protocol/generate/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type Type struct {
112112
Line int `json:"line"` // JSON source line
113113
}
114114

115-
// ParsedLiteral is Type.Value when Type.Kind is "literal"
115+
// ParseLiteral is Type.Value when Type.Kind is "literal"
116116
type ParseLiteral struct {
117117
Properties `json:"properties"`
118118
}

gopls/internal/server/general.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ func (s *server) fileOf(ctx context.Context, uri protocol.DocumentURI) (file.Han
610610
return fh, snapshot, release, nil
611611
}
612612

613-
// shutdown implements the 'shutdown' LSP handler. It releases resources
613+
// Shutdown implements the 'shutdown' LSP handler. It releases resources
614614
// associated with the server and waits for all ongoing work to complete.
615615
func (s *server) Shutdown(ctx context.Context) error {
616616
ctx, done := event.Start(ctx, "lsp.Server.shutdown")

gopls/internal/server/selection_range.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"golang.org/x/tools/internal/event"
1616
)
1717

18-
// selectionRange defines the textDocument/selectionRange feature,
18+
// SelectionRange defines the textDocument/selectionRange feature,
1919
// which, given a list of positions within a file,
2020
// reports a linked list of enclosing syntactic blocks, innermost first.
2121
//

0 commit comments

Comments
 (0)