From 30b1abe2f773680bfeb64d7ffa5f448e8df2384a Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 2 May 2014 14:38:08 -0700 Subject: [PATCH] go.tools: fix various typos LGTM=adonovan R=adonovan CC=golang-codereviews https://golang.org/cl/97920045 --- cmd/benchcmp/parse.go | 2 +- cmd/cover/cover.go | 4 ++-- dashboard/builder/main.go | 2 +- go/pointer/doc.go | 2 +- go/pointer/gen.go | 4 ++-- go/pointer/labels.go | 6 +++--- go/pointer/reflect.go | 2 +- go/pointer/testdata/arrayreflect.go | 2 +- go/pointer/testdata/hello.go | 2 +- go/ssa/emit.go | 2 +- go/ssa/interp/testdata/coverage.go | 2 +- go/types/ordering.go | 2 +- go/types/resolver.go | 2 +- imports/fix.go | 2 +- imports/imports.go | 2 +- oracle/peers.go | 2 +- oracle/referrers.go | 2 +- refactor/eg/rewrite.go | 2 +- 18 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmd/benchcmp/parse.go b/cmd/benchcmp/parse.go index c8cb5326..30102f88 100644 --- a/cmd/benchcmp/parse.go +++ b/cmd/benchcmp/parse.go @@ -102,7 +102,7 @@ func (b *Bench) String() string { } // BenchSet is a collection of benchmarks from one -// testing.B run, keyed by name to faciliate comparison. +// testing.B run, keyed by name to facilitate comparison. type BenchSet map[string][]*Bench // Parse extracts a BenchSet from testing.B output. Parse diff --git a/cmd/cover/cover.go b/cmd/cover/cover.go index 9c15f41b..f49b9db6 100644 --- a/cmd/cover/cover.go +++ b/cmd/cover/cover.go @@ -292,7 +292,7 @@ func (f *File) addImport(path string) string { var slashslash = []byte("//") // initialComments returns the prefix of content containing only -// whitepace and line comments. Any +build directives must appear +// whitespace and line comments. Any +build directives must appear // within this region. This approach is more reliable than using // go/printer to print a modified AST containing comments. // @@ -432,7 +432,7 @@ func (f *File) newCounter(start, end token.Pos, numStmt int) ast.Stmt { // // counters will be added before S1 and before S3. The block containing S2 // will be visited in a separate call. -// TODO: Nested simple blocks get unecessary (but correct) counters +// TODO: Nested simple blocks get unnecessary (but correct) counters func (f *File) addCounters(pos, blockEnd token.Pos, list []ast.Stmt, extendToClosingBrace bool) []ast.Stmt { // Special case: make sure we add a counter to an empty block. Can't do this below // or we will add a counter to an empty statement list after, say, a return statement. diff --git a/dashboard/builder/main.go b/dashboard/builder/main.go index 7facbdcd..af36db4f 100644 --- a/dashboard/builder/main.go +++ b/dashboard/builder/main.go @@ -88,7 +88,7 @@ func main() { Master: rr, } - // set up work environment, use existing enviroment if possible + // set up work environment, use existing environment if possible if goroot.Exists() || *failAll { log.Print("Found old workspace, will use it") } else { diff --git a/go/pointer/doc.go b/go/pointer/doc.go index 8cb83972..013cc107 100644 --- a/go/pointer/doc.go +++ b/go/pointer/doc.go @@ -20,7 +20,7 @@ is limited since all variants must be created a priori. We intend to add various presolving optimisations such as Pointer and Location Equivalence from (Hardekopf & Lin, SAS '07) and solver -optimisatisions such as Hybrid- and Lazy- Cycle Detection from +optimisations such as Hybrid- and Lazy- Cycle Detection from (Hardekopf & Lin, PLDI'07), diff --git a/go/pointer/gen.go b/go/pointer/gen.go index c451c8d9..c218d58e 100644 --- a/go/pointer/gen.go +++ b/go/pointer/gen.go @@ -755,7 +755,7 @@ func (a *analysis) genInvokeReflectType(caller *cgnode, site *callsite, call *ss } } -// genCall generates contraints for call instruction instr. +// genCall generates constraints for call instruction instr. func (a *analysis) genCall(caller *cgnode, instr ssa.CallInstruction) { call := instr.Common() @@ -926,7 +926,7 @@ func (a *analysis) genStore(cgn *cgnode, ptr ssa.Value, val nodeid, offset, size } } -// genInstr generates contraints for instruction instr in context cgn. +// genInstr generates constraints for instruction instr in context cgn. func (a *analysis) genInstr(cgn *cgnode, instr ssa.Instruction) { if a.log != nil { var prefix string diff --git a/go/pointer/labels.go b/go/pointer/labels.go index 3fd8681b..48a9f0b9 100644 --- a/go/pointer/labels.go +++ b/go/pointer/labels.go @@ -23,8 +23,8 @@ import ( // - arrays created by conversions (e.g. []byte("foo"), []byte(s)) // - stack- and heap-allocated variables (including composite literals) // - channels, maps and arrays created by make() -// - instrinsic or reflective operations that allocate (e.g. append, reflect.New) -// - instrinsic objects, e.g. the initial array behind os.Args. +// - intrinsic or reflective operations that allocate (e.g. append, reflect.New) +// - intrinsic objects, e.g. the initial array behind os.Args. // - and their subelements, e.g. "alloc.y[*].z" // // Labels are so varied that they defy good generalizations; @@ -87,7 +87,7 @@ func (l Label) Pos() token.Pos { // makeinterface (tagged object allocated by makeinterface) // (allocation in instrinsic) // sync.Mutex (a reflect.rtype instance) -// (an instrinsic object) +// (an intrinsic object) // // Labels within compound objects have subelement paths: // x.y[*].z (a struct variable, x) diff --git a/go/pointer/reflect.go b/go/pointer/reflect.go index ed451774..26ddaf21 100644 --- a/go/pointer/reflect.go +++ b/go/pointer/reflect.go @@ -7,7 +7,7 @@ package pointer // For consistency, the names of all parameters match those of the // actual functions in the "reflect" package. // -// To avoid proliferation of equivalent labels, instrinsics should +// To avoid proliferation of equivalent labels, intrinsics should // memoize as much as possible, like TypeOf and Zero do for their // tagged objects. // diff --git a/go/pointer/testdata/arrayreflect.go b/go/pointer/testdata/arrayreflect.go index 4b53078e..2b236740 100644 --- a/go/pointer/testdata/arrayreflect.go +++ b/go/pointer/testdata/arrayreflect.go @@ -19,7 +19,7 @@ func reflectValueSlice() { print(rvsl.Interface().([]*int)) // @pointsto makeslice@slice:15 print(rvsl.Interface().([]*int)[42]) // @pointsto main.a - // reflect.Value contains an arrayay (non-addressable). + // reflect.Value contains an array (non-addressable). array := [10]*int{&a} // @line array rvarray := reflect.ValueOf(array).Slice(0, 0) print(rvarray.Interface()) // @types diff --git a/go/pointer/testdata/hello.go b/go/pointer/testdata/hello.go index 065ff860..b81784b2 100644 --- a/go/pointer/testdata/hello.go +++ b/go/pointer/testdata/hello.go @@ -17,7 +17,7 @@ func (s *S) String() string { } func main() { - // os.Args is considered instrincally allocated, + // os.Args is considered intrinsically allocated, // but may also be set explicitly (e.g. on Windows), hence '...'. print(os.Args) // @pointsto | ... fmt.Println("Hello, World!", &theS) diff --git a/go/ssa/emit.go b/go/ssa/emit.go index 29fcde84..cb68043a 100644 --- a/go/ssa/emit.go +++ b/go/ssa/emit.go @@ -240,7 +240,7 @@ func emitConv(f *Function, val Value, typ types.Type) Value { } // emitStore emits to f an instruction to store value val at location -// addr, applying implicit conversions as required by assignabilty rules. +// addr, applying implicit conversions as required by assignability rules. // func emitStore(f *Function, addr, val Value) *Store { s := &Store{ diff --git a/go/ssa/interp/testdata/coverage.go b/go/ssa/interp/testdata/coverage.go index 503e4e2f..628f315b 100644 --- a/go/ssa/interp/testdata/coverage.go +++ b/go/ssa/interp/testdata/coverage.go @@ -404,7 +404,7 @@ func init() { // defer func() { // r := fmt.Sprint(recover()) // if r != "interface conversion: interface is nil, not main.I" { - // panic("I->I type assertion succeeed for nil value") + // panic("I->I type assertion succeeded for nil value") // } // }() // var x I diff --git a/go/types/ordering.go b/go/types/ordering.go index cc38cfed..4a647558 100644 --- a/go/types/ordering.go +++ b/go/types/ordering.go @@ -34,7 +34,7 @@ func (check *checker) resolveOrder() []Object { for _, f := range ityp.Methods.List { if len(f.Names) == 0 { // Embedded interface: The type must be a (possibly - // qualified) identifer denoting another interface. + // qualified) identifier denoting another interface. // Imported interfaces are already fully resolved, // so we can ignore qualified identifiers. if ident, _ := f.Type.(*ast.Ident); ident != nil { diff --git a/go/types/resolver.go b/go/types/resolver.go index 90217f1c..11225241 100644 --- a/go/types/resolver.go +++ b/go/types/resolver.go @@ -259,7 +259,7 @@ func (check *checker) collectObjects() { // rhs initializer (n:1 var declaration). var d1 *declInfo if len(s.Values) == 1 { - // The lhs elements are only set up after the foor loop below, + // The lhs elements are only set up after the for loop below, // but that's ok because declareVar only collects the declInfo // for a later phase. d1 = &declInfo{file: fileScope, lhs: lhs, typ: s.Type, init: s.Values[0]} diff --git a/imports/fix.go b/imports/fix.go index dd3d8170..6b41de26 100644 --- a/imports/fix.go +++ b/imports/fix.go @@ -46,7 +46,7 @@ func importGroup(importPath string) int { } func fixImports(fset *token.FileSet, f *ast.File) (added []string, err error) { - // refs are a set of possible package references currently unsatisified by imports. + // refs are a set of possible package references currently unsatisfied by imports. // first key: either base package (e.g. "fmt") or renamed package // second key: referenced package symbol (e.g. "Println") refs := make(map[string]map[string]bool) diff --git a/imports/imports.go b/imports/imports.go index dd1bc4d6..f42c3350 100644 --- a/imports/imports.go +++ b/imports/imports.go @@ -24,7 +24,7 @@ import ( // Options specifies options for processing files. type Options struct { - Fragment bool // Accept fragement of a source file (no package statement) + Fragment bool // Accept fragment of a source file (no package statement) AllErrors bool // Report all errors (not just the first 10 on different lines) Comments bool // Print comments (true if nil *Options provided) diff --git a/oracle/peers.go b/oracle/peers.go index d4c910d5..5a41073d 100644 --- a/oracle/peers.go +++ b/oracle/peers.go @@ -153,7 +153,7 @@ func chanOps(instr ssa.Instruction) []chanOp { type peersResult struct { queryPos token.Pos // of queried '<-' token queryType types.Type // type of queried channel - makes, sends, receives []token.Pos // positions of alisaed makechan/send/receive instrs + makes, sends, receives []token.Pos // positions of aliased makechan/send/receive instrs } func (r *peersResult) display(printf printfFunc) { diff --git a/oracle/referrers.go b/oracle/referrers.go index ddab2361..ae62db3d 100644 --- a/oracle/referrers.go +++ b/oracle/referrers.go @@ -71,7 +71,7 @@ func (p byNamePos) Less(i, j int) bool { return p[i].NamePos < p[j].NamePos } func (p byNamePos) Swap(i, j int) { p[i], p[j] = p[j], p[i] } type referrersResult struct { - query *ast.Ident // identifer of query + query *ast.Ident // identifier of query obj types.Object // object it denotes refs []*ast.Ident // set of all other references to it } diff --git a/refactor/eg/rewrite.go b/refactor/eg/rewrite.go index 84a8b291..7e90ee9d 100644 --- a/refactor/eg/rewrite.go +++ b/refactor/eg/rewrite.go @@ -303,7 +303,7 @@ func (tr *Transformer) subst(env map[string]ast.Expr, pattern, pos reflect.Value return pattern } -// -- utilitiies ------------------------------------------------------- +// -- utilities ------------------------------------------------------- func rvToExpr(rv reflect.Value) ast.Expr { if rv.CanInterface() {