From 786e54ea044f554a202aa31654286e7d5defbad4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 10 Aug 2018 23:34:31 +0900 Subject: [PATCH 1/4] Fix typos detected by github.com/client9/misspell --- doc/devel/weekly.html | 6 +++--- misc/cgo/test/issue9400_linux.go | 2 +- misc/cgo/testshared/shared_test.go | 2 +- src/bytes/buffer_test.go | 2 +- src/cmd/asm/internal/asm/operand_test.go | 2 +- src/cmd/asm/internal/asm/testdata/amd64enc_extra.s | 2 +- src/cmd/compile/internal/gc/ssa.go | 2 +- src/cmd/compile/internal/ssa/deadstore.go | 2 +- src/cmd/go/alldocs.go | 2 +- src/cmd/go/internal/cache/default_unix_test.go | 2 +- src/cmd/go/internal/modfetch/proxy.go | 2 +- src/cmd/go/internal/modload/load.go | 2 +- src/cmd/go/internal/work/exec.go | 2 +- src/cmd/trace/annotations.go | 1 + src/crypto/aes/gcm_arm64.s | 6 +++--- src/crypto/x509/verify.go | 2 +- src/internal/bytealg/index_arm64.s | 2 +- src/internal/trace/goroutines.go | 2 +- src/os/user/user.go | 2 +- src/runtime/asm_amd64.s | 2 +- src/runtime/sys_windows_amd64.s | 2 +- src/time/time.go | 2 +- test/fixedbugs/issue22662b.go | 2 +- test/live.go | 2 +- test/run.go | 2 +- 25 files changed, 29 insertions(+), 28 deletions(-) diff --git a/doc/devel/weekly.html b/doc/devel/weekly.html index e17461db2465dc..b99da66f2a6acc 100644 --- a/doc/devel/weekly.html +++ b/doc/devel/weekly.html @@ -1829,7 +1829,7 @@

2011-11-01

refer to tour.golang.org instead of go-tour.appspot.com. * exp/norm: fixed bug that crept in with moving to the new regexp. * exp/ssh: fix length header leaking into channel data (thanks Dave Cheney). -* fmt: handle os.Error values explicity (as distinct from Stringer). +* fmt: handle os.Error values explicitly (as distinct from Stringer). * gc: clean up printing, fix [568]g -V crash (thanks Mikio Hara), test + fix escape analysis bug. @@ -3438,7 +3438,7 @@

2011-04-13

drop Author: line on self-clpatch, recognize code URL without trailing slash. * crypto/block: remove deprecated package. -* crypto/des: new package implementating DES and TDEA (thanks Yasuhiro Matsumoto). +* crypto/des: new package implementing DES and TDEA (thanks Yasuhiro Matsumoto). * crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source (thanks Dmitry Chestnykh). * crypto/rsa: add 3-prime support, add support for precomputing CRT values, @@ -3776,7 +3776,7 @@

2011-03-07 (base for r56)

and elements are case-encoded, replacing every -// uppercase letter with an exclamation mark followed by the correponding +// uppercase letter with an exclamation mark followed by the corresponding // lower-case letter: github.com/Azure encodes as github.com/!azure. // // The JSON-formatted metadata about a given module corresponds to diff --git a/src/cmd/go/internal/cache/default_unix_test.go b/src/cmd/go/internal/cache/default_unix_test.go index a207497a42cc01..1458201f4b32a7 100644 --- a/src/cmd/go/internal/cache/default_unix_test.go +++ b/src/cmd/go/internal/cache/default_unix_test.go @@ -62,6 +62,6 @@ func TestDefaultDir(t *testing.T) { os.Setenv("HOME", "/") if _, showWarnings := defaultDir(); showWarnings { // https://golang.org/issue/26280 - t.Error("Cache initalization warnings should be squelched when $GOCACHE and $XDG_CACHE_HOME are unset and $HOME is /") + t.Error("Cache initialization warnings should be squelched when $GOCACHE and $XDG_CACHE_HOME are unset and $HOME is /") } } diff --git a/src/cmd/go/internal/modfetch/proxy.go b/src/cmd/go/internal/modfetch/proxy.go index 693eb18b49be85..5f856b80d2e16a 100644 --- a/src/cmd/go/internal/modfetch/proxy.go +++ b/src/cmd/go/internal/modfetch/proxy.go @@ -55,7 +55,7 @@ for that version of the given module. To avoid problems when serving from case-sensitive file systems, the and elements are case-encoded, replacing every -uppercase letter with an exclamation mark followed by the correponding +uppercase letter with an exclamation mark followed by the corresponding lower-case letter: github.com/Azure encodes as github.com/!azure. The JSON-formatted metadata about a given module corresponds to diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index b42d0d2e50fcca..363b327b3dda22 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -672,7 +672,7 @@ func (pkg *loadPkg) stackText() string { } // why returns the text to use in "go mod why" output about the given package. -// It is less ornate than the stackText but conatins the same information. +// It is less ornate than the stackText but contains the same information. func (pkg *loadPkg) why() string { var buf strings.Builder var stack []*loadPkg diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 9eab02554b51b5..7fbb6bbd1ee272 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -2858,7 +2858,7 @@ func useResponseFile(path string, argLen int) bool { } // On the Go build system, use response files about 10% of the - // time, just to excercise this codepath. + // time, just to exercise this codepath. isBuilder := os.Getenv("GO_BUILDER_NAME") != "" if isBuilder && rand.Intn(10) == 0 { return true diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go index 96c109e0f251a0..2c471036965363 100644 --- a/src/cmd/trace/annotations.go +++ b/src/cmd/trace/annotations.go @@ -439,6 +439,7 @@ func (task *taskDesc) complete() bool { } // descendents returns all the task nodes in the subtree rooted from this task. +// FIXIME: the method name is misspelled func (task *taskDesc) decendents() []*taskDesc { if task == nil { return nil diff --git a/src/crypto/aes/gcm_arm64.s b/src/crypto/aes/gcm_arm64.s index 98e9f5bbe59dc5..61c868cd0ca799 100644 --- a/src/crypto/aes/gcm_arm64.s +++ b/src/crypto/aes/gcm_arm64.s @@ -434,7 +434,7 @@ TEXT ·gcmAesEnc(SB),NOSPLIT,$0 VLD1 (tPtr), [ACC0.B16] VEOR ACC1.B16, ACC1.B16, ACC1.B16 VEOR ACCM.B16, ACCM.B16, ACCM.B16 - // Prepare intial counter, and the increment vector + // Prepare initial counter, and the increment vector VLD1 (ctrPtr), [CTR.B16] VEOR INC.B16, INC.B16, INC.B16 MOVD $1, H0 @@ -733,7 +733,7 @@ TEXT ·gcmAesDec(SB),NOSPLIT,$0 VLD1 (tPtr), [ACC0.B16] VEOR ACC1.B16, ACC1.B16, ACC1.B16 VEOR ACCM.B16, ACCM.B16, ACCM.B16 - // Prepare intial counter, and the increment vector + // Prepare initial counter, and the increment vector VLD1 (ctrPtr), [CTR.B16] VEOR INC.B16, INC.B16, INC.B16 MOVD $1, H0 @@ -969,7 +969,7 @@ tail: tailLast: VEOR KLAST.B16, B0.B16, B0.B16 - // Assuming it is safe to load past dstPtr due to the presense of the tag + // Assuming it is safe to load past dstPtr due to the presence of the tag VLD1 (srcPtr), [B5.B16] VEOR B5.B16, B0.B16, B0.B16 diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go index 210db4c1d0eb30..4c2ff7b7c4d3d2 100644 --- a/src/crypto/x509/verify.go +++ b/src/crypto/x509/verify.go @@ -861,7 +861,7 @@ nextIntermediate: } // validHostname returns whether host is a valid hostname that can be matched or -// matched against according to RFC 6125 2.2, with some leniency to accomodate +// matched against according to RFC 6125 2.2, with some leniency to accommodate // legacy values. func validHostname(host string) bool { host = strings.TrimSuffix(host, ".") diff --git a/src/internal/bytealg/index_arm64.s b/src/internal/bytealg/index_arm64.s index 20d68ba9b8bf89..3a551a72da1393 100644 --- a/src/internal/bytealg/index_arm64.s +++ b/src/internal/bytealg/index_arm64.s @@ -32,7 +32,7 @@ TEXT indexbody<>(SB),NOSPLIT,$0-56 // to avoid repeatedly re-load it again and again // for sebsequent substring comparisons SUB R3, R1, R4 - // R4 contains the start of last substring for comparsion + // R4 contains the start of last substring for comparison ADD R0, R4, R4 ADD $1, R0, R8 diff --git a/src/internal/trace/goroutines.go b/src/internal/trace/goroutines.go index 2d7d3aa3ae2508..a5fda489bea798 100644 --- a/src/internal/trace/goroutines.go +++ b/src/internal/trace/goroutines.go @@ -37,7 +37,7 @@ type UserRegionDesc struct { // Region end event. Normally EvUserRegion end event or nil, // but can be EvGoStop or EvGoEnd event if the goroutine - // terminated without explicitely ending the region. + // terminated without explicitly ending the region. End *Event GExecutionStat diff --git a/src/os/user/user.go b/src/os/user/user.go index 1f733b80235a54..c1b8101c8629cb 100644 --- a/src/os/user/user.go +++ b/src/os/user/user.go @@ -11,7 +11,7 @@ parses /etc/passwd and /etc/group. The other is cgo-based and relies on the standard C library (libc) routines such as getpwuid_r and getgrnam_r. When cgo is available, cgo-based (libc-backed) code is used by default. -This can be overriden by using osusergo build tag, which enforces +This can be overridden by using osusergo build tag, which enforces the pure Go implementation. */ package user diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s index 6902ce2c22c026..2c526f8fc460c2 100644 --- a/src/runtime/asm_amd64.s +++ b/src/runtime/asm_amd64.s @@ -1465,7 +1465,7 @@ GLOBL debugCallFrameTooLarge<>(SB), RODATA, $0x14 // Size duplicated below // This function communicates back to the debugger by setting RAX and // invoking INT3 to raise a breakpoint signal. See the comments in the // implementation for the protocol the debugger is expected to -// follow. InjectDebugCall in the runtime tests demonstates this protocol. +// follow. InjectDebugCall in the runtime tests demonstrates this protocol. // // The debugger must ensure that any pointers passed to the function // obey escape analysis requirements. Specifically, it must not pass diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s index c1449dba6006d0..c9127ac2d23223 100644 --- a/src/runtime/sys_windows_amd64.s +++ b/src/runtime/sys_windows_amd64.s @@ -363,7 +363,7 @@ TEXT runtime·tstart_stdcall(SB),NOSPLIT,$0 // Layout new m scheduler stack on os stack. MOVQ SP, AX MOVQ AX, (g_stack+stack_hi)(DX) - SUBQ $(64*1024), AX // inital stack size (adjusted later) + SUBQ $(64*1024), AX // initial stack size (adjusted later) MOVQ AX, (g_stack+stack_lo)(DX) ADDQ $const__StackGuard, AX MOVQ AX, g_stackguard0(DX) diff --git a/src/time/time.go b/src/time/time.go index 2374043ea3cc64..326e3b15608d95 100644 --- a/src/time/time.go +++ b/src/time/time.go @@ -1076,7 +1076,7 @@ func (t Time) Local() Time { return t } -// In returns a copy of t representating the same time instant, but +// In returns a copy of t representing the same time instant, but // with the copy's location information set to loc for display // purposes. // diff --git a/test/fixedbugs/issue22662b.go b/test/fixedbugs/issue22662b.go index 3594c0f4ef751f..2678383ab07750 100644 --- a/test/fixedbugs/issue22662b.go +++ b/test/fixedbugs/issue22662b.go @@ -18,7 +18,7 @@ import ( ) // Each of these tests is expected to fail (missing package clause) -// at the position determined by the preceeding line directive. +// at the position determined by the preceding line directive. var tests = []struct { src, pos string }{ diff --git a/test/live.go b/test/live.go index 18611f5113d634..13bdc4aae1d248 100644 --- a/test/live.go +++ b/test/live.go @@ -465,7 +465,7 @@ func f29(b bool) { // copy of array of pointers should die at end of range loop var pstructarr [10]pstruct -// Struct size choosen to make pointer to element in pstructarr +// Struct size chosen to make pointer to element in pstructarr // not computable by strength reduction. type pstruct struct { intp *int diff --git a/test/run.go b/test/run.go index 99ef79feb180c8..82508d1c1fa536 100644 --- a/test/run.go +++ b/test/run.go @@ -435,7 +435,7 @@ func (ctxt *context) match(name string) bool { func init() { checkShouldTest() } // goGcflags returns the -gcflags argument to use with go build / go run. -// This must match the flags used for building the standard libary, +// This must match the flags used for building the standard library, // or else the commands will rebuild any needed packages (like runtime) // over and over. func goGcflags() string { From c48365fe658f19070d7351ec0f29d71d683fda95 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 23 Aug 2018 12:41:31 +0900 Subject: [PATCH 2/4] Reverted historical git logs, refs https://go-review.googlesource.com/c/go/+/128955/9/doc/devel/weekly.html#1832 --- doc/devel/weekly.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/devel/weekly.html b/doc/devel/weekly.html index b99da66f2a6acc..e17461db2465dc 100644 --- a/doc/devel/weekly.html +++ b/doc/devel/weekly.html @@ -1829,7 +1829,7 @@

2011-11-01

refer to tour.golang.org instead of go-tour.appspot.com. * exp/norm: fixed bug that crept in with moving to the new regexp. * exp/ssh: fix length header leaking into channel data (thanks Dave Cheney). -* fmt: handle os.Error values explicitly (as distinct from Stringer). +* fmt: handle os.Error values explicity (as distinct from Stringer). * gc: clean up printing, fix [568]g -V crash (thanks Mikio Hara), test + fix escape analysis bug. @@ -3438,7 +3438,7 @@

2011-04-13

drop Author: line on self-clpatch, recognize code URL without trailing slash. * crypto/block: remove deprecated package. -* crypto/des: new package implementing DES and TDEA (thanks Yasuhiro Matsumoto). +* crypto/des: new package implementating DES and TDEA (thanks Yasuhiro Matsumoto). * crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source (thanks Dmitry Chestnykh). * crypto/rsa: add 3-prime support, add support for precomputing CRT values, @@ -3776,7 +3776,7 @@

2011-03-07 (base for r56)

Date: Thu, 23 Aug 2018 12:42:48 +0900 Subject: [PATCH 3/4] Fix a still remaining typo even after the modification, refs: https://go-review.googlesource.com/c/go/+/128955/9/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s#914 --- src/cmd/asm/internal/asm/testdata/amd64enc_extra.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s index 3926391918e2e2..2f0d9ecf8695fb 100644 --- a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s +++ b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s @@ -911,7 +911,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 VADDPD.BCST.Z (AX), Z2, K1, Z1 // 62f1edd95808 VMAXPD.BCST (AX), Z2, K1, Z1 // 62f1ed595f08 VMAXPD.BCST.Z (AX), Z2, K1, Z1 // 62f1edd95f08 - // EVEX: surppress all exceptions (SAE). + // EVEX: suppress all exceptions (SAE). VMAXPD.SAE Z3, Z2, K1, Z1 // 62f1ed595fcb or 62f1ed195fcb VMAXPD.SAE.Z Z3, Z2, K1, Z1 // 62f1edd95fcb or 62f1ed995fcb VMAXPD (AX), Z2, K1, Z1 // 62f1ed495f08 From ae85bcf82be8fee533e2b9901c6133921382c70a Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 23 Aug 2018 14:05:32 +0900 Subject: [PATCH 4/4] Fix a TODO comment --- src/cmd/trace/annotations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go index 2c471036965363..8071ac887967a6 100644 --- a/src/cmd/trace/annotations.go +++ b/src/cmd/trace/annotations.go @@ -439,7 +439,7 @@ func (task *taskDesc) complete() bool { } // descendents returns all the task nodes in the subtree rooted from this task. -// FIXIME: the method name is misspelled +// TODO: the method name is misspelled func (task *taskDesc) decendents() []*taskDesc { if task == nil { return nil