diff --git a/go/types/typeutil/map_test.go b/go/types/typeutil/map_test.go index 2cc1de786dc..1874de5ba17 100644 --- a/go/types/typeutil/map_test.go +++ b/go/types/typeutil/map_test.go @@ -45,7 +45,7 @@ func TestAxioms(t *testing.T) { func TestMap(t *testing.T) { var tmap *typeutil.Map - // All methods but Set are safe on on (*T)(nil). + // All methods but Set are safe on (*T)(nil). tmap.Len() tmap.At(tPStr1) tmap.Delete(tPStr1) diff --git a/gopls/internal/cache/metadata/metadata.go b/gopls/internal/cache/metadata/metadata.go index b6355166640..826edd15cdb 100644 --- a/gopls/internal/cache/metadata/metadata.go +++ b/gopls/internal/cache/metadata/metadata.go @@ -154,7 +154,7 @@ func (mp *Package) String() string { return string(mp.ID) } // to discard them before requesting type checking, or the products of // type-checking such as the cross-reference index or method set index. // -// MetadataForFile doesn't do this filtering itself becaused in some +// MetadataForFile doesn't do this filtering itself because in some // cases we need to make a reverse dependency query on the metadata // graph, and it's important to include the rdeps of ITVs in that // query. But the filtering of ITVs should be applied after that step, diff --git a/gopls/internal/protocol/generate/main.go b/gopls/internal/protocol/generate/main.go index dc3a6c8fbd4..29d2f8871f3 100644 --- a/gopls/internal/protocol/generate/main.go +++ b/gopls/internal/protocol/generate/main.go @@ -172,7 +172,7 @@ func writeprotocol() { fmt.Fprintln(out, fileHdr) out.WriteString("import \"encoding/json\"\n\n") - // The followiing are unneeded, but make the new code a superset of the old + // The following are unneeded, but make the new code a superset of the old hack := func(newer, existing string) { if _, ok := types[existing]; !ok { log.Fatalf("types[%q] not found", existing) diff --git a/gopls/internal/test/integration/bench/repo_test.go b/gopls/internal/test/integration/bench/repo_test.go index 73390a78885..0e86f3e1da7 100644 --- a/gopls/internal/test/integration/bench/repo_test.go +++ b/gopls/internal/test/integration/bench/repo_test.go @@ -135,7 +135,7 @@ type repo struct { inDir *string // if set, use this dir as url@commit, and don't delete dirOnce sync.Once - dir string // directory contaning source code checked out to url@commit + dir string // directory containing source code checked out to url@commit // shared editor state editorOnce sync.Once diff --git a/gopls/internal/test/integration/misc/webserver_test.go b/gopls/internal/test/integration/misc/webserver_test.go index 85ccfc56f13..29f8607bfa2 100644 --- a/gopls/internal/test/integration/misc/webserver_test.go +++ b/gopls/internal/test/integration/misc/webserver_test.go @@ -183,7 +183,7 @@ func Constructor() Type }) } -// viewPkgDoc invokes the "View package documention" code action in +// viewPkgDoc invokes the "View package documentation" code action in // the specified file. It returns the URI of the document, or fails // the test. func viewPkgDoc(t *testing.T, env *Env, filename string) protocol.URI { diff --git a/internal/apidiff/testdata/tests.go b/internal/apidiff/testdata/tests.go index 014e813027c..567e6077758 100644 --- a/internal/apidiff/testdata/tests.go +++ b/internal/apidiff/testdata/tests.go @@ -62,7 +62,7 @@ type u1 int var V5 u1 // new -var V5 u2 // OK: V5 has changed type, but old u1 corresopnds to new u2 +var V5 u2 // OK: V5 has changed type, but old u1 corresponds to new u2 //// Splitting a single type into two is an incompatible change. // both diff --git a/internal/diff/lcs/old.go b/internal/diff/lcs/old.go index a14ae9119ca..4353da15ba9 100644 --- a/internal/diff/lcs/old.go +++ b/internal/diff/lcs/old.go @@ -86,7 +86,7 @@ func (lcs lcs) toDiffs(alen, blen int) []Diff { // --- FORWARD --- -// fdone decides if the forwward path has reached the upper right +// fdone decides if the forward path has reached the upper right // corner of the rectangle. If so, it also returns the computed lcs. func (e *editGraph) fdone(D, k int) (bool, lcs) { // x, y, k are relative to the rectangle diff --git a/internal/diff/lcs/old_test.go b/internal/diff/lcs/old_test.go index e39941ba0a5..ddc3bde0ed2 100644 --- a/internal/diff/lcs/old_test.go +++ b/internal/diff/lcs/old_test.go @@ -129,7 +129,7 @@ func TestRandOld(t *testing.T) { } // TestDiffAPI tests the public API functions (Diff{Bytes,Strings,Runes}) -// to ensure at least miminal parity of the three representations. +// to ensure at least minimal parity of the three representations. func TestDiffAPI(t *testing.T) { for _, test := range []struct { a, b string diff --git a/internal/facts/facts.go b/internal/facts/facts.go index f0aa97ec1bf..e1c18d373c3 100644 --- a/internal/facts/facts.go +++ b/internal/facts/facts.go @@ -295,10 +295,10 @@ func (s *Set) Encode() []byte { // we aren't careful about which structs or methods // we rexport: it should be only those referenced // from the API of s.pkg. - // TOOD(adonovan): opt: be more precise. e.g. + // TODO(adonovan): opt: be more precise. e.g. // intersect with the set of objects computed by // importMap(s.pkg.Imports()). - // TOOD(adonovan): opt: implement "shallow" facts. + // TODO(adonovan): opt: implement "shallow" facts. if k.pkg != s.pkg { if k.obj == nil { continue // imported package fact diff --git a/internal/facts/facts_test.go b/internal/facts/facts_test.go index daebea2ff59..c1e67926eff 100644 --- a/internal/facts/facts_test.go +++ b/internal/facts/facts_test.go @@ -272,7 +272,7 @@ type pkgLookups struct { // 2. calls (*facts.Decoder).Decode to load the facts exported by its imports, // 3. exports a myFact Fact for all of package level objects, // 4. For each lookup for the current package: -// 4.a) lookup the types.Object for an Go source expression in the curent package +// 4.a) lookup the types.Object for a Go source expression in the current package // (or confirms one is not expected want=="no object"), // 4.b) finds a Fact for the object (or confirms one is not expected want=="no fact"), // 4.c) compares the content of the Fact to want. diff --git a/internal/jsonrpc2_v2/jsonrpc2_test.go b/internal/jsonrpc2_v2/jsonrpc2_test.go index dd8d09c8870..d75a20739e8 100644 --- a/internal/jsonrpc2_v2/jsonrpc2_test.go +++ b/internal/jsonrpc2_v2/jsonrpc2_test.go @@ -240,7 +240,7 @@ func newResults(expect interface{}) interface{} { func verifyResults(t *testing.T, method string, results interface{}, expect interface{}) { if expect == nil { if results != nil { - t.Errorf("%v:Got results %+v where none expeted", method, expect) + t.Errorf("%v:Got results %+v where none expected", method, expect) } return } diff --git a/internal/typeparams/common.go b/internal/typeparams/common.go index 9771b8c3d69..89bd256dc67 100644 --- a/internal/typeparams/common.go +++ b/internal/typeparams/common.go @@ -73,7 +73,7 @@ func IsTypeParam(t types.Type) bool { // implements the following rule for uninstantiated generic types: // // If V and T are generic named types, then V is considered assignable to T if, -// for every possible instantation of V[A_1, ..., A_N], the instantiation +// for every possible instantiation of V[A_1, ..., A_N], the instantiation // T[A_1, ..., A_N] is valid and V[A_1, ..., A_N] implements T[A_1, ..., A_N]. // // If T has structural constraints, they must be satisfied by V. diff --git a/internal/typesinternal/errorcode.go b/internal/typesinternal/errorcode.go index e0c27ed251c..834e05381ce 100644 --- a/internal/typesinternal/errorcode.go +++ b/internal/typesinternal/errorcode.go @@ -1449,10 +1449,10 @@ const ( NotAGenericType // WrongTypeArgCount occurs when a type or function is instantiated with an - // incorrent number of type arguments, including when a generic type or + // incorrect number of type arguments, including when a generic type or // function is used without instantiation. // - // Errors inolving failed type inference are assigned other error codes. + // Errors involving failed type inference are assigned other error codes. // // Example: // type T[p any] int