Skip to content

Commit

Permalink
all: fix some typos in comments
Browse files Browse the repository at this point in the history
Change-Id: I5d5f6cc4a6984b8577e8178082bc60dfe08107b6
GitHub-Last-Rev: 16ede6b
GitHub-Pull-Request: #490
Reviewed-on: https://go-review.googlesource.com/c/tools/+/580156
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
  • Loading branch information
racequite authored and gopherbot committed Apr 22, 2024
1 parent 8db95b7 commit 97ea816
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion go/types/typeutil/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/cache/metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/protocol/generate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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 @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/test/integration/misc/webserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/apidiff/testdata/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/diff/lcs/old.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/diff/lcs/old_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/facts/facts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/facts/facts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/jsonrpc2_v2/jsonrpc2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion internal/typeparams/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions internal/typesinternal/errorcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97ea816

Please sign in to comment.