Skip to content

Commit 0efbd10

Browse files
ainar-ggriesemer
authored andcommitted
all: fix typos
Use the following (suboptimal) script to obtain a list of possible typos: #!/usr/bin/env sh set -x git ls-files |\ grep -e '\.\(c\|cc\|go\)$' |\ xargs -n 1\ awk\ '/\/\// { gsub(/.*\/\//, ""); print; } /\/\*/, /\*\// { gsub(/.*\/\*/, ""); gsub(/\*\/.*/, ""); }' |\ hunspell -d en_US -l |\ grep '^[[:upper:]]\{0,1\}[[:lower:]]\{1,\}$' |\ grep -v -e '^.\{1,4\}$' -e '^.\{16,\}$' |\ sort -f |\ uniq -c |\ awk '$1 == 1 { print $2; }' Then, go through the results manually and fix the most obvious typos in the non-vendored code. Change-Id: I3cb5830a176850e1a0584b8a40b47bde7b260eae Reviewed-on: https://go-review.googlesource.com/c/go/+/193848 Reviewed-by: Robert Griesemer <gri@golang.org>
1 parent 83a78eb commit 0efbd10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+78
-78
lines changed

src/cmd/compile/internal/gc/const.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ type constSetKey struct {
12941294
// equal value and identical type has already been added, then add
12951295
// reports an error about the duplicate value.
12961296
//
1297-
// pos provides position information for where expression n occured
1297+
// pos provides position information for where expression n occurred
12981298
// (in case n does not have its own position information). what and
12991299
// where are used in the error message.
13001300
//

src/cmd/compile/internal/gc/escape.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// First, we construct a directed weighted graph where vertices
2525
// (termed "locations") represent variables allocated by statements
2626
// and expressions, and edges represent assignments between variables
27-
// (with weights reperesenting addressing/dereference counts).
27+
// (with weights representing addressing/dereference counts).
2828
//
2929
// Next we walk the graph looking for assignment paths that might
3030
// violate the invariants stated above. If a variable v's address is
@@ -33,7 +33,7 @@ import (
3333
//
3434
// To support interprocedural analysis, we also record data-flow from
3535
// each function's parameters to the heap and to its result
36-
// parameters. This information is summarized as "paremeter tags",
36+
// parameters. This information is summarized as "parameter tags",
3737
// which are used at static call sites to improve escape analysis of
3838
// function arguments.
3939

@@ -44,7 +44,7 @@ import (
4444
// "location."
4545
//
4646
// We also model every Go assignment as a directed edges between
47-
// locations. The number of derefence operations minus the number of
47+
// locations. The number of dereference operations minus the number of
4848
// addressing operations is recorded as the edge's weight (termed
4949
// "derefs"). For example:
5050
//

src/cmd/compile/internal/gc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ func Main(archInit func(*Arch)) {
570570
fcount++
571571
}
572572
}
573-
// With all types ckecked, it's now safe to verify map keys. One single
573+
// With all types checked, it's now safe to verify map keys. One single
574574
// check past phase 9 isn't sufficient, as we may exit with other errors
575575
// before then, thus skipping map key errors.
576576
checkMapKeys()

src/cmd/compile/internal/gc/sinit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ func isStaticCompositeLiteral(n *Node) bool {
495495
// literal components of composite literals.
496496
// Dynamic initialization represents non-literals and
497497
// non-literal components of composite literals.
498-
// LocalCode initializion represents initialization
498+
// LocalCode initialization represents initialization
499499
// that occurs purely in generated code local to the function of use.
500500
// Initialization code is sometimes generated in passes,
501501
// first static then dynamic.

src/cmd/compile/internal/gc/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ var fpConvOpToSSA32 = map[twoTypes]twoOpsAndType{
16451645
twoTypes{TFLOAT64, TUINT32}: twoOpsAndType{ssa.OpCvt64Fto32U, ssa.OpCopy, TUINT32},
16461646
}
16471647

1648-
// uint64<->float conversions, only on machines that have intructions for that
1648+
// uint64<->float conversions, only on machines that have instructions for that
16491649
var uint64fpConvOpToSSA = map[twoTypes]twoOpsAndType{
16501650
twoTypes{TUINT64, TFLOAT32}: twoOpsAndType{ssa.OpCopy, ssa.OpCvt64Uto32F, TUINT64},
16511651
twoTypes{TUINT64, TFLOAT64}: twoOpsAndType{ssa.OpCopy, ssa.OpCvt64Uto64F, TUINT64},

src/cmd/compile/internal/gc/syntax.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ const (
691691
ORECV // <-Left
692692
ORUNESTR // Type(Left) (Type is string, Left is rune)
693693
OSELRECV // Left = <-Right.Left: (appears as .Left of OCASE; Right.Op == ORECV)
694-
OSELRECV2 // List = <-Right.Left: (apperas as .Left of OCASE; count(List) == 2, Right.Op == ORECV)
694+
OSELRECV2 // List = <-Right.Left: (appears as .Left of OCASE; count(List) == 2, Right.Op == ORECV)
695695
OIOTA // iota
696696
OREAL // real(Left)
697697
OIMAG // imag(Left)

src/cmd/compile/internal/gc/walk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ opswitch:
12651265
}
12661266
// Map initialization with a variable or large hint is
12671267
// more complicated. We therefore generate a call to
1268-
// runtime.makemap to intialize hmap and allocate the
1268+
// runtime.makemap to initialize hmap and allocate the
12691269
// map buckets.
12701270

12711271
// When hint fits into int, use makemap instead of

src/cmd/compile/internal/ssa/branchelim.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func shouldElimIfElse(no, yes, post *Block, arch string) bool {
319319
cost := phi * 1
320320
if phi > 1 {
321321
// If we have more than 1 phi and some values in post have args
322-
// in yes or no blocks, we may have to recalucalte condition, because
322+
// in yes or no blocks, we may have to recalculate condition, because
323323
// those args may clobber flags. For now assume that all operations clobber flags.
324324
cost += other * 1
325325
}

src/cmd/compile/internal/ssa/deadstore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func elimDeadAutosGeneric(f *Func) {
180180
}
181181
return
182182
case OpStore, OpMove, OpZero:
183-
// v should be elimated if we eliminate the auto.
183+
// v should be eliminated if we eliminate the auto.
184184
n, ok := addr[args[0]]
185185
if ok && elim[v] == nil {
186186
elim[v] = n

src/cmd/compile/internal/ssa/debug_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ func replaceEnv(env []string, ev string, evv string) []string {
959959
}
960960

961961
// asCommandLine renders cmd as something that could be copy-and-pasted into a command line
962-
// If cwd is not empty and different from the command's directory, prepend an approprirate "cd"
962+
// If cwd is not empty and different from the command's directory, prepend an appropriate "cd"
963963
func asCommandLine(cwd string, cmd *exec.Cmd) string {
964964
s := "("
965965
if cmd.Dir != "" && cmd.Dir != cwd {

0 commit comments

Comments
 (0)