all: fix some typos in comments

Change-Id: I5d5f6cc4a6984b8577e8178082bc60dfe08107b6
GitHub-Last-Rev: 16ede6bf75
GitHub-Pull-Request: golang/tools#490
Reviewed-on: https://go-review.googlesource.com/c/tools/+/580156
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
racequite 2024-04-20 00:47:01 +00:00 коммит произвёл Gopher Robot
Родитель 8db95b70d2
Коммит 97ea8165d8
13 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -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)

2
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,

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -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 {

2
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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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.

Просмотреть файл

@ -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
}

Просмотреть файл

@ -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.

Просмотреть файл

@ -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