From 6150ddb324b4f0915a0e1926c49e6fa94632f677 Mon Sep 17 00:00:00 2001 From: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Date: Mon, 1 Apr 2024 22:52:51 +0200 Subject: [PATCH] Fix registered trademark and other acronyms --- README.md | 8 ++++---- README_zh_cn.md | 4 ++-- cmd/exec_tool/main.go | 2 +- cmd/xgo/main.go | 2 +- cmd/xgo/patch_compiler.go | 6 +++--- cmd/xgo/pathsum/path.go | 2 +- cmd/xgo/pathsum/path_test.go | 2 +- cmd/xgo/upgrade/upgrade.go | 2 +- patch/ir.go | 2 +- script/install/upgrade/upgrade.go | 2 +- support/filecopy/copy_bench_test.go | 2 +- test/build.go | 2 +- tools/README.md | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index fc05b139..a70bd164 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ See [Quick Start](#quick-start) and [Documentation](./doc) for more details. # macOS and Linux (and WSL) curl -fsSL https://github.com/xhd2015/xgo/raw/master/install.sh | bash -# windows +# Windows powershell -c "irm github.com/xhd2015/xgo/raw/master/install.ps1|iex" ``` @@ -417,11 +417,11 @@ So I created `xgo`, so I hope `xgo` will also take over other solutions to the m # Comparing `xgo` with `monkey` The project [bouk/monkey](https://github.com/bouk/monkey), was initially created by bouk, as described in his blog https://bou.ke/blog/monkey-patching-in-go. -In short, it uses a low level assembly hack to replace function at runtime. Which exposes lots of confusing problems to its users as it gets used more and more widely(especially on MacOS). +In short, it uses a low level assembly hack to replace function at runtime. Which exposes lots of confusing problems to its users as it gets used more and more widely(especially on macOS). -Then it was archived and no longer maintained by the author himself. However, two projects later take over the asm idea and add support for newer go versions and architectures like Apple M1. +Then it was archived and no longer maintained by the author himself. However, two projects later take over the ASM idea and add support for newer go versions and architectures like Apple M1. -Still, the two does not solve the underlying compatibility issues introduced by asm, including cross-platform support, the need to write to a read-only section of the execution code and lacking of general mock. +Still, the two does not solve the underlying compatibility issues introduced by ASM, including cross-platform support, the need to write to a read-only section of the execution code and lacking of general mock. So developers still get annoying failures every now and then. diff --git a/README_zh_cn.md b/README_zh_cn.md index 8e839216..64b76d7f 100644 --- a/README_zh_cn.md +++ b/README_zh_cn.md @@ -25,7 +25,7 @@ # macOS和Linux(包括 WSL) curl -fsSL https://github.com/xhd2015/xgo/raw/master/install.sh | bash -# windows +# Windows powershell -c "irm github.com/xhd2015/xgo/raw/master/install.ps1|iex" ``` @@ -56,7 +56,7 @@ xgo version 对OS和Arch没有限制, `xgo`支持所有`go`支持的OS和Arch。 OS: -- MacOS +- macOS - Linux - Windows (+WSL) - ... diff --git a/cmd/exec_tool/main.go b/cmd/exec_tool/main.go index 32169072..5318ec30 100644 --- a/cmd/exec_tool/main.go +++ b/cmd/exec_tool/main.go @@ -59,7 +59,7 @@ func main() { os.Exit(1) } - // on windows, cmd ends with .exe + // on Windows, cmd ends with .exe baseName := filepath.Base(cmd) isCompile := baseName == "compile" if !isCompile && runtime.GOOS == "windows" { diff --git a/cmd/xgo/main.go b/cmd/xgo/main.go index 274b8a68..a52b0620 100644 --- a/cmd/xgo/main.go +++ b/cmd/xgo/main.go @@ -222,7 +222,7 @@ func handleBuild(cmd string, args []string) error { logDebug("instrument dir: %s", instrumentDir) exeSuffix := osinfo.EXE_SUFFIX - // NOTE: on windows, go build -o xxx will always yield xxx.exe + // NOTE: on Windows, go build -o xxx will always yield xxx.exe execToolBin := filepath.Join(binDir, "exec_tool"+exeSuffix) compileLog := filepath.Join(logDir, "compile.log") compilerBin := filepath.Join(instrumentDir, "compile"+exeSuffix) diff --git a/cmd/xgo/patch_compiler.go b/cmd/xgo/patch_compiler.go index 20e08313..ef4b13aa 100644 --- a/cmd/xgo/patch_compiler.go +++ b/cmd/xgo/patch_compiler.go @@ -135,7 +135,7 @@ func patchGcMain(goroot string, goVersion *goinfo.GoVersion) error { } // turn off inline when there is rewrite(gcflags=-l) - // windows: also turn off optimization(gcflags=-N) + // Windows: also turn off optimization(gcflags=-N) var flagNSwitch = "" if runtime.GOOS == "windows" { flagNSwitch = "\n" + "base.Flag.N = 1" @@ -282,7 +282,7 @@ func importCompileInternalPatch(goroot string, xgoSrc string, forceReset bool, s if isDevelopment { symLink := syncWithLink if osinfo.FORCE_COPY_UNSYM { - // windows: A required privilege is not held by the client. + // Windows: A required privilege is not held by the client. symLink = false } // copy compiler internal dependencies @@ -325,7 +325,7 @@ func importCompileInternalPatch(goroot string, xgoSrc string, forceReset bool, s if path == "patch_compiler" { return os.MkdirAll(dstDir, 0755) } - // TODO: test on windows if "/" works + // TODO: test on Windows if "/" works dstPath := filepath.Join(dstDir, strings.TrimPrefix(path, "patch_compiler/")) if d.IsDir() { return os.MkdirAll(dstPath, 0755) diff --git a/cmd/xgo/pathsum/path.go b/cmd/xgo/pathsum/path.go index 16d5fc95..9b13e0e9 100644 --- a/cmd/xgo/pathsum/path.go +++ b/cmd/xgo/pathsum/path.go @@ -37,7 +37,7 @@ func shortPath(path string, maxSeg int) string { // seg = strings.ReplaceAll(seg, "?", "") // seg = strings.ReplaceAll(seg, "$", "") // seg = strings.ReplaceAll(seg, "&", "") - // seg = strings.ReplaceAll(seg, ":", "") // windows + // seg = strings.ReplaceAll(seg, ":", "") // Windows // seg = strings.ReplaceAll(seg, ";", "") // seg = strings.ReplaceAll(seg, "%", "") // seg = strings.ReplaceAll(seg, "#", "") diff --git a/cmd/xgo/pathsum/path_test.go b/cmd/xgo/pathsum/path_test.go index 68b9c974..3afa065c 100644 --- a/cmd/xgo/pathsum/path_test.go +++ b/cmd/xgo/pathsum/path_test.go @@ -11,7 +11,7 @@ func TestProcessSpecial(t *testing.T) { {"", ""}, {"/", ""}, {"/a", "a"}, - {"C:/a", "Ca"}, // windows + {"C:/a", "Ca"}, // Windows {"C:\\a", "Ca"}, {"/ab/c", "abc"}, {"/ab/c", "abc"}, diff --git a/cmd/xgo/upgrade/upgrade.go b/cmd/xgo/upgrade/upgrade.go index b895b8ac..548559b5 100644 --- a/cmd/xgo/upgrade/upgrade.go +++ b/cmd/xgo/upgrade/upgrade.go @@ -79,7 +79,7 @@ func Upgrade(installDir string) error { return err } } else { - // windows + // Windows tmpUnzip := filepath.Join(tmpDir, "unzip") err = os.MkdirAll(tmpUnzip, 0755) if err != nil { diff --git a/patch/ir.go b/patch/ir.go index 00182ab0..d62256fa 100644 --- a/patch/ir.go +++ b/patch/ir.go @@ -192,7 +192,7 @@ func getAdjustedFile(f string) string { if runtime.GOOS != "windows" { return "" } - // for windows, posFile has the form: + // for Windows, posFile has the form: // C:/a/b/c // while syncDeclMapping's file has the form: // C:\a\b\c diff --git a/script/install/upgrade/upgrade.go b/script/install/upgrade/upgrade.go index 3413fcde..84de5f5d 100755 --- a/script/install/upgrade/upgrade.go +++ b/script/install/upgrade/upgrade.go @@ -81,7 +81,7 @@ func Upgrade(installDir string) error { return err } } else { - // windows + // Windows tmpUnzip := filepath.Join(tmpDir, "unzip") err = os.MkdirAll(tmpUnzip, 0755) if err != nil { diff --git a/support/filecopy/copy_bench_test.go b/support/filecopy/copy_bench_test.go index d4e68ac0..ca24d43a 100644 --- a/support/filecopy/copy_bench_test.go +++ b/support/filecopy/copy_bench_test.go @@ -36,7 +36,7 @@ func TestExampleCopy5g(t *testing.T) { // go test -run TestExampleCopy10g -v ./support/filecopy func TestExampleCopy10g(t *testing.T) { checkSkip(t) - // on windows this took 4.79s + // on Windows this took 4.79s testCopyDir(t, "go1.22.1", 10) } diff --git a/test/build.go b/test/build.go index a5f85942..1bb54d13 100644 --- a/test/build.go +++ b/test/build.go @@ -38,7 +38,7 @@ func linkRuntimeAndTest(testDir string, goModOnly bool) (rootDir string, subDir return "", "", err } - // windows no link + // Windows no link if runtime.GOOS != "windows" { // copy runtime to a tmp directory, and // test under there diff --git a/tools/README.md b/tools/README.md index 6dd26497..9d10fe37 100644 --- a/tools/README.md +++ b/tools/README.md @@ -64,7 +64,7 @@ Usage: ```sh ./with-go-devel ./debug.sh build -v -gcflags \"all=-N -l\" -o ./test_trap.bin ./test/test_trap ``` -Or just use the vscode launch config `Launch test_trap`. +Or just use the VS Code launch config `Launch test_trap`. Example: