diff --git a/cmd/digraph/digraph.go b/cmd/digraph/digraph.go index 4c682c3ecb..6bbff9665a 100644 --- a/cmd/digraph/digraph.go +++ b/cmd/digraph/digraph.go @@ -397,7 +397,7 @@ func digraph(cmd string, args []string) error { case "transpose": if len(args) != 0 { - return fmt.Errorf("usage: digraph tranpose") + return fmt.Errorf("usage: digraph transpose") } var revEdges []string for node, succs := range g.transpose() { diff --git a/cmd/fiximports/main.go b/cmd/fiximports/main.go index 7de018fdbe..520cbb7e3c 100644 --- a/cmd/fiximports/main.go +++ b/cmd/fiximports/main.go @@ -58,7 +58,7 @@ // The -baddomains flag is a list of domain names that should always be // considered non-canonical. You can use this if you wish to make sure // that you no longer have any dependencies on packages from that -// domain, even those that do not yet provide a canical import path +// domain, even those that do not yet provide a canonical import path // comment. For example, the default value of -baddomains includes the // moribund code hosting site code.google.com, so fiximports will report // an error for each import of a package from this domain remaining diff --git a/cmd/stringer/golden_test.go b/cmd/stringer/golden_test.go index cef64b01cb..ff0f6682ba 100644 --- a/cmd/stringer/golden_test.go +++ b/cmd/stringer/golden_test.go @@ -25,7 +25,7 @@ type Golden struct { trimPrefix string lineComment bool input string // input; the package clause is provided when running the test. - output string // exected output. + output string // expected output. } var golden = []Golden{ diff --git a/go/analysis/analysistest/analysistest.go b/go/analysis/analysistest/analysistest.go index 5ecb55304f..0d323dc583 100644 --- a/go/analysis/analysistest/analysistest.go +++ b/go/analysis/analysistest/analysistest.go @@ -329,7 +329,7 @@ func (ex expectation) String() string { } // parseExpectations parses the content of a "// want ..." comment -// and returns the expections, a mixture of diagnostics ("rx") and +// and returns the expectations, a mixture of diagnostics ("rx") and // facts (name:"rx"). func parseExpectations(text string) ([]expectation, error) { var scanErr string diff --git a/go/analysis/analysistest/analysistest_test.go b/go/analysis/analysistest/analysistest_test.go index 9d0e2b97bb..2b08542865 100644 --- a/go/analysis/analysistest/analysistest_test.go +++ b/go/analysis/analysistest/analysistest_test.go @@ -42,7 +42,7 @@ func main() { print() // want foo: print() // want "\xZZ scan error" - // A dignostic is reported at this line, but the expectation doesn't match: + // A diagnostic is reported at this line, but the expectation doesn't match: println("hello, world") // want "wrong expectation text" // An unexpected diagnostic is reported at this line: diff --git a/go/analysis/doc/suggested_fixes.md b/go/analysis/doc/suggested_fixes.md index b43e99c289..f46871ab86 100644 --- a/go/analysis/doc/suggested_fixes.md +++ b/go/analysis/doc/suggested_fixes.md @@ -110,7 +110,7 @@ code review systems to suggest fixes that users can apply from their code review ### Performing transformations directly on the AST -Even though it may be more convienient +Even though it may be more convenient for authors of refactorings to perform transformations directly on the AST, allowing mutations on the AST would mean that a copy of the AST would need to be made every time a transformation was produced, to avoid diff --git a/go/analysis/internal/analysisflags/flags.go b/go/analysis/internal/analysisflags/flags.go index 14274eaacf..0778f42207 100644 --- a/go/analysis/internal/analysisflags/flags.go +++ b/go/analysis/internal/analysisflags/flags.go @@ -209,7 +209,7 @@ func (versionFlag) Set(s string) error { log.Fatalf("unsupported flag value: -V=%s", s) } - // This replicates the miminal subset of + // This replicates the minimal subset of // cmd/internal/objabi.AddVersionFlag, which is private to the // go tool yet forms part of our command-line interface. // TODO(adonovan): clarify the contract. diff --git a/go/analysis/internal/checker/checker.go b/go/analysis/internal/checker/checker.go index 4a29a968f4..8802e9a8b0 100644 --- a/go/analysis/internal/checker/checker.go +++ b/go/analysis/internal/checker/checker.go @@ -457,7 +457,7 @@ func printDiagnostics(roots []*action) (exitcode int) { visitAll(roots) if exitcode == 0 && len(seen) > 0 { - exitcode = 3 // successfuly produced diagnostics + exitcode = 3 // successfully produced diagnostics } } diff --git a/go/analysis/internal/checker/checker_test.go b/go/analysis/internal/checker/checker_test.go index 152a997f41..d8272780c0 100644 --- a/go/analysis/internal/checker/checker_test.go +++ b/go/analysis/internal/checker/checker_test.go @@ -58,7 +58,7 @@ func Foo() { got := string(contents) if got != want { - t.Errorf("contents of rewrtitten file\ngot: %s\nwant: %s", got, want) + t.Errorf("contents of rewritten file\ngot: %s\nwant: %s", got, want) } defer cleanup() diff --git a/go/analysis/passes/printf/types.go b/go/analysis/passes/printf/types.go index 5000d9acc9..bd8a594ef5 100644 --- a/go/analysis/passes/printf/types.go +++ b/go/analysis/passes/printf/types.go @@ -234,7 +234,7 @@ func matchStructArgType(pass *analysis.Pass, t printfArgType, typ *types.Struct, return false } if t&argString != 0 && !typf.Exported() && isConvertibleToString(pass, typf.Type()) { - // Issue #17798: unexported Stringer or error cannot be properly fomatted. + // Issue #17798: unexported Stringer or error cannot be properly formatted. return false } } diff --git a/go/buildutil/overlay.go b/go/buildutil/overlay.go index 3f71c4fef7..8e239086bd 100644 --- a/go/buildutil/overlay.go +++ b/go/buildutil/overlay.go @@ -65,7 +65,7 @@ func OverlayContext(orig *build.Context, overlay map[string][]byte) *build.Conte // // The archive consists of a series of files. Each file consists of a // name, a decimal file size and the file contents, separated by -// newlinews. No newline follows after the file contents. +// newlines. No newline follows after the file contents. func ParseOverlayArchive(archive io.Reader) (map[string][]byte, error) { overlay := make(map[string][]byte) r := bufio.NewReader(archive) diff --git a/go/internal/gcimporter/bexport_test.go b/go/internal/gcimporter/bexport_test.go index 89870b1ada..de7b921af0 100644 --- a/go/internal/gcimporter/bexport_test.go +++ b/go/internal/gcimporter/bexport_test.go @@ -245,7 +245,7 @@ func equalType(x, y types.Type) error { return fmt.Errorf("results: %s", err) } if x.Variadic() != y.Variadic() { - return fmt.Errorf("unequal varidicity: %t vs %t", + return fmt.Errorf("unequal variadicity: %t vs %t", x.Variadic(), y.Variadic()) } if (x.Recv() != nil) != (y.Recv() != nil) { diff --git a/go/packages/golist.go b/go/packages/golist.go index 4a362865c4..88e0cbc708 100644 --- a/go/packages/golist.go +++ b/go/packages/golist.go @@ -678,7 +678,7 @@ func golistDriver(cfg *Config, rootsDirs func() *goInfo, words ...string) (*driv // go list -e, when given an absolute path, will find the package contained at // that directory. But when no package exists there, it will return a fake package // with an error and the ImportPath set to the absolute path provided to go list. - // Try toto convert that absolute path to what its package path would be if it's + // Try to convert that absolute path to what its package path would be if it's // contained in a known module or GOPATH entry. This will allow the package to be // properly "reclaimed" when overlays are processed. if filepath.IsAbs(p.ImportPath) && p.Error != nil { diff --git a/go/packages/packages_test.go b/go/packages/packages_test.go index 7b79dc1aa7..1f73688c48 100644 --- a/go/packages/packages_test.go +++ b/go/packages/packages_test.go @@ -2158,7 +2158,7 @@ func testAdHocContains(t *testing.T, exporter packagestest.Exporter) { t.Fatalf("Imports of loaded package: want [fmt], got %v", pkg.Imports) } if len(pkg.GoFiles) != 1 || pkg.GoFiles[0] != filename { - t.Fatalf("GoFiles of loaded packge: want [%s], got %v", filename, pkg.GoFiles) + t.Fatalf("GoFiles of loaded package: want [%s], got %v", filename, pkg.GoFiles) } } diff --git a/go/packages/packagestest/expect.go b/go/packages/packagestest/expect.go index cf4b6738d6..ef41606ff0 100644 --- a/go/packages/packagestest/expect.go +++ b/go/packages/packagestest/expect.go @@ -118,7 +118,7 @@ func (e *Exported) Expect(methods map[string]interface{}) error { return nil } -// Range is a type alias for span.Range for backwards compatability, prefer +// Range is a type alias for span.Range for backwards compatibility, prefer // using span.Range directly. type Range = span.Range diff --git a/go/pointer/gen.go b/go/pointer/gen.go index a111175c99..f2a51715b7 100644 --- a/go/pointer/gen.go +++ b/go/pointer/gen.go @@ -512,7 +512,7 @@ func (a *analysis) genAppend(instr *ssa.Call, cgn *cgnode) { a.addressOf(instr.Type(), a.valueNode(z), w) // z = &w } -// genBuiltinCall generates contraints for a call to a built-in. +// genBuiltinCall generates constraints for a call to a built-in. func (a *analysis) genBuiltinCall(instr ssa.CallInstruction, cgn *cgnode) { call := instr.Common() switch call.Value.(*ssa.Builtin).Name() { diff --git a/go/pointer/hvn.go b/go/pointer/hvn.go index 48051ae7da..192e4050dd 100644 --- a/go/pointer/hvn.go +++ b/go/pointer/hvn.go @@ -89,7 +89,7 @@ package pointer // their expanded-out sets are equal. // * HR (HVN with deReference---see paper): this will require that we // apply HVN until fixed point, which may need more bookkeeping of the -// correspondance of main nodes to onodes. +// correspondence of main nodes to onodes. // * Location Equivalence (see paper): have points-to sets contain not // locations but location-equivalence class labels, each representing // a set of locations. diff --git a/go/ssa/ssautil/load.go b/go/ssa/ssautil/load.go index 659d19fdbb..6d65b78ef2 100644 --- a/go/ssa/ssautil/load.go +++ b/go/ssa/ssautil/load.go @@ -46,7 +46,7 @@ func Packages(initial []*packages.Package, mode ssa.BuilderMode) (*ssa.Program, // // AllPackages creates an SSA package for each well-typed package in the // initial list, plus all their dependencies. The resulting list of -// packages corresponds to the list of intial packages, and may contain +// packages corresponds to the list of initial packages, and may contain // a nil if SSA code could not be constructed for the corresponding // initial package due to type errors. // diff --git a/go/types/objectpath/objectpath.go b/go/types/objectpath/objectpath.go index 0d85488efb..882e3b3d8a 100644 --- a/go/types/objectpath/objectpath.go +++ b/go/types/objectpath/objectpath.go @@ -376,7 +376,7 @@ func Object(pkg *types.Package, p Path) (types.Object, error) { return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj) } - // abtraction of *types.{Pointer,Slice,Array,Chan,Map} + // abstraction of *types.{Pointer,Slice,Array,Chan,Map} type hasElem interface { Elem() types.Type } diff --git a/godoc/godoc.go b/godoc/godoc.go index c84816a256..84a53a388d 100644 --- a/godoc/godoc.go +++ b/godoc/godoc.go @@ -881,7 +881,7 @@ func (p *Presentation) writeNode(w io.Writer, pageInfo *PageInfo, fset *token.Fi log.Print(err) } - // Add comments to struct fields saying which Go version introducd them. + // Add comments to struct fields saying which Go version introduced them. if structName != "" { fieldSince := apiInfo.fieldSince[structName] typeSince := apiInfo.typeSince[structName] diff --git a/gopls/doc/design.md b/gopls/doc/design.md index ad2af7d1de..1787869265 100644 --- a/gopls/doc/design.md +++ b/gopls/doc/design.md @@ -189,7 +189,7 @@ It could run as a daemon on the user's machine, but there are a lot of issues wi Persistent disk caches are very expensive to maintain, and require solving a lot of extra problems. Although building the information required is expensive compared to the latencies required of the requests, it is fairly minor compared to the startup times of an editor, so it is expected that rebuilding the information when gopls is restarted will be acceptable. -The advantage gained from this is that gopls becomes stateless across restarts which means if it has issues or gets its state confused, a simle restart will often fix the problem. +The advantage gained from this is that gopls becomes stateless across restarts which means if it has issues or gets its state confused, a simple restart will often fix the problem. It also means that when users report problems, the entire state of the on disk cache is not needed to diagnose and reproduce the issue. ### Communication: *stdin/stdout JSON* diff --git a/internal/apidiff/README.md b/internal/apidiff/README.md index 04a1f4e702..3d9576c286 100644 --- a/internal/apidiff/README.md +++ b/internal/apidiff/README.md @@ -265,7 +265,7 @@ var x = C // old type is int64, new is int var y int64 = x // fails with new: different types in assignment ``` -A change to the value of a constant can break compatiblity if the value is used +A change to the value of a constant can break compatibility if the value is used in an array type: ``` diff --git a/internal/imports/mod_test.go b/internal/imports/mod_test.go index a2a72ce674..50cbe60964 100644 --- a/internal/imports/mod_test.go +++ b/internal/imports/mod_test.go @@ -586,7 +586,7 @@ type modTest struct { cleanup func() } -// setup builds a test enviroment from a txtar and supporting modules +// setup builds a test environment from a txtar and supporting modules // in testdata/mod, along the lines of TestScript in cmd/go. func setup(t *testing.T, main, wd string) *modTest { t.Helper() diff --git a/internal/jsonrpc2/handler.go b/internal/jsonrpc2/handler.go index 0b04c9031f..598c79b570 100644 --- a/internal/jsonrpc2/handler.go +++ b/internal/jsonrpc2/handler.go @@ -8,7 +8,7 @@ import ( "context" ) -// Handler is the interface used to hook into the mesage handling of an rpc +// Handler is the interface used to hook into the message handling of an rpc // connection. type Handler interface { // Deliver is invoked to handle incoming requests. diff --git a/internal/jsonrpc2/jsonrpc2.go b/internal/jsonrpc2/jsonrpc2.go index 8dd0bd91de..f9c402168d 100644 --- a/internal/jsonrpc2/jsonrpc2.go +++ b/internal/jsonrpc2/jsonrpc2.go @@ -49,7 +49,7 @@ type Request struct { WireRequest } -// NewErrorf builds a Error struct for the suppied message and code. +// NewErrorf builds a Error struct for the supplied message and code. // If args is not empty, message and args will be passed to Sprintf. func NewErrorf(code int64, format string, args ...interface{}) *Error { return &Error{ diff --git a/internal/lsp/cache/parse.go b/internal/lsp/cache/parse.go index 643b1d8a03..328847c571 100644 --- a/internal/lsp/cache/parse.go +++ b/internal/lsp/cache/parse.go @@ -281,7 +281,7 @@ FindTo: // // If the previous token was a "." and we are looking at a "}", // the period is likely a dangling selector and needs a phantom - // "_". Likewise if the currnet token is on a different line than + // "_". Likewise if the current token is on a different line than // the period, the period is likely a dangling selector. if lastToken == token.PERIOD && (tkn == token.RBRACE || tok.Line(to) > tok.Line(last)) { // Insert phantom "_" selector after the dangling ".". diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index f8d7a36ea9..3a2f93f9e9 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -364,7 +364,7 @@ func (f *goFile) invalidateContent(ctx context.Context) { f.handle = nil } -// invalidateMeta invalides package metadata for all files in f's +// invalidateMeta invalidates package metadata for all files in f's // package. This forces f's package's metadata to be reloaded next // time the package is checked. func (f *goFile) invalidateMeta(ctx context.Context) { diff --git a/internal/lsp/debug/serve.go b/internal/lsp/debug/serve.go index 6e53502a27..0a935274f6 100644 --- a/internal/lsp/debug/serve.go +++ b/internal/lsp/debug/serve.go @@ -357,7 +357,7 @@ var memoryTmpl = template.Must(template.Must(BaseTemplate.Clone()).Parse(` Stack in use bytes{{fuint64 .StackInuse}} Stack from system bytes{{fuint64 .StackSys}} Bucket hash bytes{{fuint64 .BuckHashSys}} -GC metaata bytes{{fuint64 .GCSys}} +GC metadata bytes{{fuint64 .GCSys}} Off heap bytes{{fuint64 .OtherSys}}

By size

diff --git a/internal/lsp/diff/myers/diff.go b/internal/lsp/diff/myers/diff.go index 8c2daeb2c2..4bbe3dd0b9 100644 --- a/internal/lsp/diff/myers/diff.go +++ b/internal/lsp/diff/myers/diff.go @@ -139,7 +139,7 @@ func Operations(a, b []string) []*Op { // backtrack uses the trace for the edit sequence computation and returns the // "snakes" that make up the solution. A "snake" is a single deletion or -// insertion followed by zero or diagnonals. +// insertion followed by zero or diagonals. func backtrack(trace [][]int, x, y, offset int) [][]int { snakes := make([][]int, len(trace)) d := len(trace) - 1 diff --git a/internal/lsp/fuzzy/matcher.go b/internal/lsp/fuzzy/matcher.go index 0ae2137160..0b53cec58f 100644 --- a/internal/lsp/fuzzy/matcher.go +++ b/internal/lsp/fuzzy/matcher.go @@ -114,7 +114,7 @@ func (m *Matcher) SetInput(input Input) { } // Score returns the score returned by matching the candidate to the pattern. -// This is not designed for parallel use. Multiple candidates must be scored sequentally. +// This is not designed for parallel use. Multiple candidates must be scored sequentially. // Returns a score between 0 and 1 (0 - no match, 1 - perfect match). func (m *Matcher) Score(candidate string) float32 { if len(candidate) > MaxInputSize { diff --git a/internal/lsp/source/completion.go b/internal/lsp/source/completion.go index 127503e6c6..79787bec16 100644 --- a/internal/lsp/source/completion.go +++ b/internal/lsp/source/completion.go @@ -170,7 +170,7 @@ type completer struct { // surrounding describes the identifier surrounding the position. surrounding *Selection - // expectedType conains information about the type we expect the completion + // expectedType contains information about the type we expect the completion // candidate to be. It will be the zero value if no information is available. expectedType typeInference diff --git a/internal/lsp/source/source_test.go b/internal/lsp/source/source_test.go index 1b88f88648..9734b79c38 100644 --- a/internal/lsp/source/source_test.go +++ b/internal/lsp/source/source_test.go @@ -130,7 +130,7 @@ func (r *runner) Completion(t *testing.T, data tests.Completions, snippets tests } // If deep completion is enabled, we need to use the fuzzy matcher to match - // the code's behvaior. + // the code's behavior. if deepComplete { if fuzzyMatcher != nil && fuzzyMatcher.Score(item.Label) < 0 { continue diff --git a/internal/lsp/source/view.go b/internal/lsp/source/view.go index dbd8f2b133..0480cc289b 100644 --- a/internal/lsp/source/view.go +++ b/internal/lsp/source/view.go @@ -160,7 +160,7 @@ type Session interface { // Cache returns the cache that created this session. Cache() Cache - // View returns a view with a mathing name, if the session has one. + // View returns a view with a matching name, if the session has one. View(name string) View // ViewOf returns a view corresponding to the given URI. diff --git a/internal/memoize/memoize.go b/internal/memoize/memoize.go index 279185ce98..b4b5b86a60 100644 --- a/internal/memoize/memoize.go +++ b/internal/memoize/memoize.go @@ -5,11 +5,11 @@ // Package memoize supports memoizing the return values of functions with // idempotent results that are expensive to compute. // -// The memoizied result is returned again the next time the function is invoked. +// The memoized result is returned again the next time the function is invoked. // To prevent excessive memory use, the return values are only remembered // for as long as they still have a user. // -// To use this package, build a store and use it to aquire handles with the +// To use this package, build a store and use it to acquire handles with the // Bind method. // package memoize @@ -49,7 +49,7 @@ type Handle struct { type entry struct { noCopy key interface{} - // mu contols access to the typ and ptr fields + // mu controls access to the typ and ptr fields mu sync.Mutex // the calculated value, as stored in an interface{} typ, ptr uintptr diff --git a/internal/span/span_test.go b/internal/span/span_test.go index 2ce698d133..8212d0cb12 100644 --- a/internal/span/span_test.go +++ b/internal/span/span_test.go @@ -46,7 +46,7 @@ func TestFormat(t *testing.T) { for fi, format := range []string{"%v", "%#v", "%+v"} { expect := toPath(test[fi]) if got := fmt.Sprintf(format, complete); got != expect { - t.Errorf("printing completeted %q as %q got %q expected %q [%+v]", text, format, got, expect, spn) + t.Errorf("printing completed %q as %q got %q expected %q [%+v]", text, format, got, expect, spn) } } } diff --git a/internal/telemetry/tag/tag.go b/internal/telemetry/tag/tag.go index cb37d6334a..c6192aba95 100644 --- a/internal/telemetry/tag/tag.go +++ b/internal/telemetry/tag/tag.go @@ -18,7 +18,7 @@ import ( //TODO: Do we need to do something more efficient than just store tags //TODO: directly on the context? -// Tagger is the interface to somthing that returns a Tag given a context. +// Tagger is the interface to something that returns a Tag given a context. // Both Tag itself and Key support this interface, allowing methods that can // take either (and other implementations as well) type Tagger interface { diff --git a/refactor/satisfy/find.go b/refactor/satisfy/find.go index 9b365b9b33..34b349e154 100644 --- a/refactor/satisfy/find.go +++ b/refactor/satisfy/find.go @@ -55,7 +55,7 @@ import ( ) // A Constraint records the fact that the RHS type does and must -// satisify the LHS type, which is an interface. +// satisfy the LHS type, which is an interface. // The names are suggestive of an assignment statement LHS = RHS. type Constraint struct { LHS, RHS types.Type