all: fix more typos

Change-Id: I978ad5e1800ebfceb78aaced438331a8341715d4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194697
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ainar Garipov 2019-09-11 09:14:36 +03:00 committed by Brad Fitzpatrick
parent 663385e6ef
commit feee8acb39
37 changed files with 39 additions and 39 deletions

View File

@ -397,7 +397,7 @@ func digraph(cmd string, args []string) error {
case "transpose": case "transpose":
if len(args) != 0 { if len(args) != 0 {
return fmt.Errorf("usage: digraph tranpose") return fmt.Errorf("usage: digraph transpose")
} }
var revEdges []string var revEdges []string
for node, succs := range g.transpose() { for node, succs := range g.transpose() {

View File

@ -58,7 +58,7 @@
// The -baddomains flag is a list of domain names that should always be // 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 // considered non-canonical. You can use this if you wish to make sure
// that you no longer have any dependencies on packages from that // 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 // comment. For example, the default value of -baddomains includes the
// moribund code hosting site code.google.com, so fiximports will report // moribund code hosting site code.google.com, so fiximports will report
// an error for each import of a package from this domain remaining // an error for each import of a package from this domain remaining

View File

@ -25,7 +25,7 @@ type Golden struct {
trimPrefix string trimPrefix string
lineComment bool lineComment bool
input string // input; the package clause is provided when running the test. input string // input; the package clause is provided when running the test.
output string // exected output. output string // expected output.
} }
var golden = []Golden{ var golden = []Golden{

View File

@ -329,7 +329,7 @@ func (ex expectation) String() string {
} }
// parseExpectations parses the content of a "// want ..." comment // 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"). // facts (name:"rx").
func parseExpectations(text string) ([]expectation, error) { func parseExpectations(text string) ([]expectation, error) {
var scanErr string var scanErr string

View File

@ -42,7 +42,7 @@ func main() {
print() // want foo: print() // want foo:
print() // want "\xZZ scan error" 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" println("hello, world") // want "wrong expectation text"
// An unexpected diagnostic is reported at this line: // An unexpected diagnostic is reported at this line:

View File

@ -110,7 +110,7 @@ code review systems to suggest fixes that users can apply from their code review
### Performing transformations directly on the AST ### 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 for authors of refactorings to perform transformations directly on
the AST, allowing mutations on the AST would mean that a copy of the AST 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 would need to be made every time a transformation was produced, to avoid

View File

@ -209,7 +209,7 @@ func (versionFlag) Set(s string) error {
log.Fatalf("unsupported flag value: -V=%s", s) 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 // cmd/internal/objabi.AddVersionFlag, which is private to the
// go tool yet forms part of our command-line interface. // go tool yet forms part of our command-line interface.
// TODO(adonovan): clarify the contract. // TODO(adonovan): clarify the contract.

View File

@ -457,7 +457,7 @@ func printDiagnostics(roots []*action) (exitcode int) {
visitAll(roots) visitAll(roots)
if exitcode == 0 && len(seen) > 0 { if exitcode == 0 && len(seen) > 0 {
exitcode = 3 // successfuly produced diagnostics exitcode = 3 // successfully produced diagnostics
} }
} }

View File

@ -58,7 +58,7 @@ func Foo() {
got := string(contents) got := string(contents)
if got != want { 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() defer cleanup()

View File

@ -234,7 +234,7 @@ func matchStructArgType(pass *analysis.Pass, t printfArgType, typ *types.Struct,
return false return false
} }
if t&argString != 0 && !typf.Exported() && isConvertibleToString(pass, typf.Type()) { 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 return false
} }
} }

View File

@ -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 // The archive consists of a series of files. Each file consists of a
// name, a decimal file size and the file contents, separated by // 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) { func ParseOverlayArchive(archive io.Reader) (map[string][]byte, error) {
overlay := make(map[string][]byte) overlay := make(map[string][]byte)
r := bufio.NewReader(archive) r := bufio.NewReader(archive)

View File

@ -245,7 +245,7 @@ func equalType(x, y types.Type) error {
return fmt.Errorf("results: %s", err) return fmt.Errorf("results: %s", err)
} }
if x.Variadic() != y.Variadic() { 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()) x.Variadic(), y.Variadic())
} }
if (x.Recv() != nil) != (y.Recv() != nil) { if (x.Recv() != nil) != (y.Recv() != nil) {

View File

@ -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 // 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 // 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. // 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 // contained in a known module or GOPATH entry. This will allow the package to be
// properly "reclaimed" when overlays are processed. // properly "reclaimed" when overlays are processed.
if filepath.IsAbs(p.ImportPath) && p.Error != nil { if filepath.IsAbs(p.ImportPath) && p.Error != nil {

View File

@ -2158,7 +2158,7 @@ func testAdHocContains(t *testing.T, exporter packagestest.Exporter) {
t.Fatalf("Imports of loaded package: want [fmt], got %v", pkg.Imports) t.Fatalf("Imports of loaded package: want [fmt], got %v", pkg.Imports)
} }
if len(pkg.GoFiles) != 1 || pkg.GoFiles[0] != filename { 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)
} }
} }

View File

@ -118,7 +118,7 @@ func (e *Exported) Expect(methods map[string]interface{}) error {
return nil 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. // using span.Range directly.
type Range = span.Range type Range = span.Range

View File

@ -512,7 +512,7 @@ func (a *analysis) genAppend(instr *ssa.Call, cgn *cgnode) {
a.addressOf(instr.Type(), a.valueNode(z), w) // z = &w 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) { func (a *analysis) genBuiltinCall(instr ssa.CallInstruction, cgn *cgnode) {
call := instr.Common() call := instr.Common()
switch call.Value.(*ssa.Builtin).Name() { switch call.Value.(*ssa.Builtin).Name() {

View File

@ -89,7 +89,7 @@ package pointer
// their expanded-out sets are equal. // their expanded-out sets are equal.
// * HR (HVN with deReference---see paper): this will require that we // * HR (HVN with deReference---see paper): this will require that we
// apply HVN until fixed point, which may need more bookkeeping of the // 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 // * Location Equivalence (see paper): have points-to sets contain not
// locations but location-equivalence class labels, each representing // locations but location-equivalence class labels, each representing
// a set of locations. // a set of locations.

View File

@ -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 // AllPackages creates an SSA package for each well-typed package in the
// initial list, plus all their dependencies. The resulting list of // 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 // a nil if SSA code could not be constructed for the corresponding
// initial package due to type errors. // initial package due to type errors.
// //

View File

@ -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) 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 { type hasElem interface {
Elem() types.Type Elem() types.Type
} }

View File

@ -881,7 +881,7 @@ func (p *Presentation) writeNode(w io.Writer, pageInfo *PageInfo, fset *token.Fi
log.Print(err) 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 != "" { if structName != "" {
fieldSince := apiInfo.fieldSince[structName] fieldSince := apiInfo.fieldSince[structName]
typeSince := apiInfo.typeSince[structName] typeSince := apiInfo.typeSince[structName]

View File

@ -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. 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. 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. 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* ### Communication: *stdin/stdout JSON*

View File

@ -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 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: in an array type:
``` ```

View File

@ -586,7 +586,7 @@ type modTest struct {
cleanup func() 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. // in testdata/mod, along the lines of TestScript in cmd/go.
func setup(t *testing.T, main, wd string) *modTest { func setup(t *testing.T, main, wd string) *modTest {
t.Helper() t.Helper()

View File

@ -8,7 +8,7 @@ import (
"context" "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. // connection.
type Handler interface { type Handler interface {
// Deliver is invoked to handle incoming requests. // Deliver is invoked to handle incoming requests.

View File

@ -49,7 +49,7 @@ type Request struct {
WireRequest 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. // If args is not empty, message and args will be passed to Sprintf.
func NewErrorf(code int64, format string, args ...interface{}) *Error { func NewErrorf(code int64, format string, args ...interface{}) *Error {
return &Error{ return &Error{

View File

@ -281,7 +281,7 @@ FindTo:
// //
// If the previous token was a "." and we are looking at a "}", // If the previous token was a "." and we are looking at a "}",
// the period is likely a dangling selector and needs a phantom // 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. // the period, the period is likely a dangling selector.
if lastToken == token.PERIOD && (tkn == token.RBRACE || tok.Line(to) > tok.Line(last)) { if lastToken == token.PERIOD && (tkn == token.RBRACE || tok.Line(to) > tok.Line(last)) {
// Insert phantom "_" selector after the dangling ".". // Insert phantom "_" selector after the dangling ".".

View File

@ -364,7 +364,7 @@ func (f *goFile) invalidateContent(ctx context.Context) {
f.handle = nil 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 // package. This forces f's package's metadata to be reloaded next
// time the package is checked. // time the package is checked.
func (f *goFile) invalidateMeta(ctx context.Context) { func (f *goFile) invalidateMeta(ctx context.Context) {

View File

@ -357,7 +357,7 @@ var memoryTmpl = template.Must(template.Must(BaseTemplate.Clone()).Parse(`
<tr><td class="label">Stack in use bytes</td><td class="value">{{fuint64 .StackInuse}}</td></tr> <tr><td class="label">Stack in use bytes</td><td class="value">{{fuint64 .StackInuse}}</td></tr>
<tr><td class="label">Stack from system bytes</td><td class="value">{{fuint64 .StackSys}}</td></tr> <tr><td class="label">Stack from system bytes</td><td class="value">{{fuint64 .StackSys}}</td></tr>
<tr><td class="label">Bucket hash bytes</td><td class="value">{{fuint64 .BuckHashSys}}</td></tr> <tr><td class="label">Bucket hash bytes</td><td class="value">{{fuint64 .BuckHashSys}}</td></tr>
<tr><td class="label">GC metaata bytes</td><td class="value">{{fuint64 .GCSys}}</td></tr> <tr><td class="label">GC metadata bytes</td><td class="value">{{fuint64 .GCSys}}</td></tr>
<tr><td class="label">Off heap bytes</td><td class="value">{{fuint64 .OtherSys}}</td></tr> <tr><td class="label">Off heap bytes</td><td class="value">{{fuint64 .OtherSys}}</td></tr>
</table> </table>
<h2>By size</h2> <h2>By size</h2>

View File

@ -139,7 +139,7 @@ func Operations(a, b []string) []*Op {
// backtrack uses the trace for the edit sequence computation and returns the // 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 // "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 { func backtrack(trace [][]int, x, y, offset int) [][]int {
snakes := make([][]int, len(trace)) snakes := make([][]int, len(trace))
d := len(trace) - 1 d := len(trace) - 1

View File

@ -114,7 +114,7 @@ func (m *Matcher) SetInput(input Input) {
} }
// Score returns the score returned by matching the candidate to the pattern. // 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). // Returns a score between 0 and 1 (0 - no match, 1 - perfect match).
func (m *Matcher) Score(candidate string) float32 { func (m *Matcher) Score(candidate string) float32 {
if len(candidate) > MaxInputSize { if len(candidate) > MaxInputSize {

View File

@ -170,7 +170,7 @@ type completer struct {
// surrounding describes the identifier surrounding the position. // surrounding describes the identifier surrounding the position.
surrounding *Selection 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. // candidate to be. It will be the zero value if no information is available.
expectedType typeInference expectedType typeInference

View File

@ -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 // 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 deepComplete {
if fuzzyMatcher != nil && fuzzyMatcher.Score(item.Label) < 0 { if fuzzyMatcher != nil && fuzzyMatcher.Score(item.Label) < 0 {
continue continue

View File

@ -160,7 +160,7 @@ type Session interface {
// Cache returns the cache that created this session. // Cache returns the cache that created this session.
Cache() Cache 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 View(name string) View
// ViewOf returns a view corresponding to the given URI. // ViewOf returns a view corresponding to the given URI.

View File

@ -5,11 +5,11 @@
// Package memoize supports memoizing the return values of functions with // Package memoize supports memoizing the return values of functions with
// idempotent results that are expensive to compute. // 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 // To prevent excessive memory use, the return values are only remembered
// for as long as they still have a user. // 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. // Bind method.
// //
package memoize package memoize
@ -49,7 +49,7 @@ type Handle struct {
type entry struct { type entry struct {
noCopy noCopy
key interface{} key interface{}
// mu contols access to the typ and ptr fields // mu controls access to the typ and ptr fields
mu sync.Mutex mu sync.Mutex
// the calculated value, as stored in an interface{} // the calculated value, as stored in an interface{}
typ, ptr uintptr typ, ptr uintptr

View File

@ -46,7 +46,7 @@ func TestFormat(t *testing.T) {
for fi, format := range []string{"%v", "%#v", "%+v"} { for fi, format := range []string{"%v", "%#v", "%+v"} {
expect := toPath(test[fi]) expect := toPath(test[fi])
if got := fmt.Sprintf(format, complete); got != expect { 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)
} }
} }
} }

View File

@ -18,7 +18,7 @@ import (
//TODO: Do we need to do something more efficient than just store tags //TODO: Do we need to do something more efficient than just store tags
//TODO: directly on the context? //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 // Both Tag itself and Key support this interface, allowing methods that can
// take either (and other implementations as well) // take either (and other implementations as well)
type Tagger interface { type Tagger interface {

View File

@ -55,7 +55,7 @@ import (
) )
// A Constraint records the fact that the RHS type does and must // 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. // The names are suggestive of an assignment statement LHS = RHS.
type Constraint struct { type Constraint struct {
LHS, RHS types.Type LHS, RHS types.Type