Skip to content

Commit

Permalink
tools: fix typos in docs and comments
Browse files Browse the repository at this point in the history
Change-Id: I24d372c18122805b14c4f1214a7e18345397af9e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/644136
Reviewed-by: Alan Donovan <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Commit-Queue: Ian Lance Taylor <[email protected]>
  • Loading branch information
merrickclay authored and gopherbot committed Jan 27, 2025
1 parent 891e3b6 commit edafbe5
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion cmd/file2fuzz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// output to stdout. If any position arguments are provided stdin is ignored
// and the arguments are assumed to be input files to convert.
//
// The -o flag provides an path to write output files to. If only one positional
// The -o flag provides a path to write output files to. If only one positional
// argument is specified it may be a file path or an existing directory, if there are
// multiple inputs specified it must be a directory. If a directory is provided
// the name of the file will be the SHA-256 hash of its contents.
Expand Down
2 changes: 1 addition & 1 deletion go/analysis/passes/pkgfact/pkgfact.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var Analyzer = &analysis.Analyzer{
}

// A pairsFact is a package-level fact that records
// an set of key=value strings accumulated from constant
// a set of key=value strings accumulated from constant
// declarations in this package and its dependencies.
// Elements are ordered by keys, which are unique.
type pairsFact []string
Expand Down
2 changes: 1 addition & 1 deletion go/analysis/passes/unreachable/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
// unreachable: check for unreachable code
//
// The unreachable analyzer finds statements that execution can never reach
// because they are preceded by an return statement, a call to panic, an
// because they are preceded by a return statement, a call to panic, an
// infinite loop, or similar constructs.
package unreachable
2 changes: 1 addition & 1 deletion go/callgraph/vta/propagation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func TestPropagation(t *testing.T) {
"Local(t2)": "A;B;C",
},
},
// The outer loop of subsumed-scc pushes A an B through the graph.
// The outer loop of subsumed-scc pushes A and B through the graph.
{name: "subsumed-scc", graph: suite["subsumed-scc"],
want: map[string]string{
"Local(t0)": "A;B",
Expand Down
2 changes: 1 addition & 1 deletion go/expect/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
const commentStart = "@"
const commentStartLen = len(commentStart)

// Identifier is the type for an identifier in an Note argument list.
// Identifier is the type for an identifier in a Note argument list.
type Identifier string

// Parse collects all the notes present in a file.
Expand Down
2 changes: 1 addition & 1 deletion go/loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ func TestVendorCwdIssue16580(t *testing.T) {
// - TypeCheckFuncBodies hook

func TestTransitivelyErrorFreeFlag(t *testing.T) {
// Create an minimal custom build.Context
// Create a minimal custom build.Context
// that fakes the following packages:
//
// a --> b --> c! c has an error
Expand Down
2 changes: 1 addition & 1 deletion go/packages/packagestest/expect.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func (e *Exported) rangeConverter(n *expect.Note, args []interface{}) (Range, []
eof := tokFile.Pos(tokFile.Size())
return newRange(tokFile, eof, eof), args, nil
default:
// look up an marker by name
// look up a marker by name
mark, ok := e.markers[string(arg)]
if !ok {
return Range{}, nil, fmt.Errorf("cannot find marker %v", arg)
Expand Down
2 changes: 1 addition & 1 deletion go/ssa/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func TestRuntimeTypes(t *testing.T) {
input string
want []string
}{
// An package-level type is needed.
// A package-level type is needed.
{`package A; type T struct{}; func (T) f() {}; var x any = T{}`,
[]string{"*p.T", "p.T"},
},
Expand Down
2 changes: 1 addition & 1 deletion go/ssa/emit.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
// emitAlloc emits to f a new Alloc instruction allocating a variable
// of type typ.
//
// The caller must set Alloc.Heap=true (for an heap-allocated variable)
// The caller must set Alloc.Heap=true (for a heap-allocated variable)
// or add the Alloc to f.Locals (for a frame-allocated variable).
//
// During building, a variable in f.Locals may have its Heap flag
Expand Down
2 changes: 1 addition & 1 deletion gopls/doc/analyzers.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ Package documentation: [unmarshal](https://pkg.go.dev/golang.org/x/tools/go/anal


The unreachable analyzer finds statements that execution can never reach
because they are preceded by an return statement, a call to panic, an
because they are preceded by a return statement, a call to panic, an
infinite loop, or similar constructs.

Default: on.
Expand Down
2 changes: 1 addition & 1 deletion gopls/doc/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func formatDefault(reflectField reflect.Value) (string, error) {
return string(defBytes), err
}

// valueDoc transforms a docstring documenting an constant identifier to a
// valueDoc transforms a docstring documenting a constant identifier to a
// docstring documenting its value.
//
// If doc is of the form "Foo is a bar", it returns '`"fooValue"` is a bar'. If
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/cache/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type InitializationError struct {

func byURI(d *Diagnostic) protocol.DocumentURI { return d.URI } // For use in maps.Group.

// An Diagnostic corresponds to an LSP Diagnostic.
// A Diagnostic corresponds to an LSP Diagnostic.
// https://microsoft.github.io/language-server-protocol/specification#diagnostic
//
// It is (effectively) gob-serializable; see {encode,decode}Diagnostics.
Expand Down
4 changes: 2 additions & 2 deletions gopls/internal/doc/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@
},
{
"Name": "\"unreachable\"",
"Doc": "check for unreachable code\n\nThe unreachable analyzer finds statements that execution can never reach\nbecause they are preceded by an return statement, a call to panic, an\ninfinite loop, or similar constructs.",
"Doc": "check for unreachable code\n\nThe unreachable analyzer finds statements that execution can never reach\nbecause they are preceded by a return statement, a call to panic, an\ninfinite loop, or similar constructs.",
"Default": "true"
},
{
Expand Down Expand Up @@ -1310,7 +1310,7 @@
},
{
"Name": "unreachable",
"Doc": "check for unreachable code\n\nThe unreachable analyzer finds statements that execution can never reach\nbecause they are preceded by an return statement, a call to panic, an\ninfinite loop, or similar constructs.",
"Doc": "check for unreachable code\n\nThe unreachable analyzer finds statements that execution can never reach\nbecause they are preceded by a return statement, a call to panic, an\ninfinite loop, or similar constructs.",
"URL": "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/unreachable",
"Default": true
},
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/server/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (s *server) Rename(ctx context.Context, params *protocol.RenameParams) (*pr
}

// Because we don't handle directory renaming within golang.Rename, golang.Rename returns
// boolean value isPkgRenaming to determine whether an DocumentChanges of type RenameFile should
// boolean value isPkgRenaming to determine whether any DocumentChanges of type RenameFile should
// be added to the return protocol.WorkspaceEdit value.
edits, isPkgRenaming, err := golang.Rename(ctx, snapshot, fh, params.Position, params.NewName)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/test/integration/bench/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type repo struct {
// reusableDir return a reusable directory for benchmarking, or "".
//
// If the user specifies a directory, the test will create and populate it
// on the first run an re-use it on subsequent runs. Otherwise it will
// on the first run and re-use it on subsequent runs. Otherwise it will
// create, populate, and delete a temporary directory.
func (r *repo) reusableDir() string {
if r.inDir == nil {
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/vulncheck/vulntest/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type Package struct {
DerivedSymbols []string `yaml:"derived_symbols,omitempty"`
}

// Version is an SemVer 2.0.0 semantic version with no leading "v" prefix,
// Version is a SemVer 2.0.0 semantic version with no leading "v" prefix,
// as used by OSV.
type Version string

Expand Down
2 changes: 1 addition & 1 deletion internal/event/export/metric/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type HistogramInt64 struct {
Buckets []int64
}

// HistogramFloat64 represents the construction information for an float64 histogram metric.
// HistogramFloat64 represents the construction information for a float64 histogram metric.
type HistogramFloat64 struct {
// Name is the unique name of this metric.
Name string
Expand Down
2 changes: 1 addition & 1 deletion internal/expect/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
const commentStart = "@"
const commentStartLen = len(commentStart)

// Identifier is the type for an identifier in an Note argument list.
// Identifier is the type for an identifier in a Note argument list.
type Identifier string

// Parse collects all the notes present in a file.
Expand Down
2 changes: 1 addition & 1 deletion internal/gocommand/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"golang.org/x/tools/internal/event/label"
)

// An Runner will run go command invocations and serialize
// A Runner will run go command invocations and serialize
// them if it sees a concurrency error.
type Runner struct {
// once guards the runner initialization.
Expand Down
2 changes: 1 addition & 1 deletion internal/jsonrpc2/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Request interface {
Message
// Method is a string containing the method name to invoke.
Method() string
// Params is an JSON value (object, array, null, or "") with the parameters of the method.
// Params is a JSON value (object, array, null, or "") with the parameters of the method.
Params() json.RawMessage
// isJSONRPC2Request is used to make the set of request implementations closed.
isJSONRPC2Request()
Expand Down
2 changes: 1 addition & 1 deletion internal/jsonrpc2/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func HandlerServer(h Handler) StreamServer {
})
}

// ListenAndServe starts an jsonrpc2 server on the given address. If
// ListenAndServe starts a jsonrpc2 server on the given address. If
// idleTimeout is non-zero, ListenAndServe exits after there are no clients for
// this duration, otherwise it exits only on error.
func ListenAndServe(ctx context.Context, network, addr string, server StreamServer, idleTimeout time.Duration) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/packagestest/expect.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func (e *Exported) rangeConverter(n *expect.Note, args []interface{}) (Range, []
eof := tokFile.Pos(tokFile.Size())
return newRange(tokFile, eof, eof), args, nil
default:
// look up an marker by name
// look up a marker by name
mark, ok := e.markers[string(arg)]
if !ok {
return Range{}, nil, fmt.Errorf("cannot find marker %v", arg)
Expand Down
2 changes: 1 addition & 1 deletion internal/typesinternal/errorcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ const (
// var _ = string(x)
InvalidConversion

// InvalidUntypedConversion occurs when an there is no valid implicit
// InvalidUntypedConversion occurs when there is no valid implicit
// conversion from an untyped value satisfying the type constraints of the
// context in which it is used.
//
Expand Down
2 changes: 1 addition & 1 deletion playground/socket/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//go:build !appengine
// +build !appengine

// Package socket implements an WebSocket-based playground backend.
// Package socket implements a WebSocket-based playground backend.
// Clients connect to a websocket handler and send run/kill commands, and
// the server sends the output and exit status of the running processes.
// Multiple clients running multiple processes may be served concurrently.
Expand Down

0 comments on commit edafbe5

Please sign in to comment.