Skip to content

Commit bbc9d10

Browse files
authored
fix: failpoint-toolexec not working on Windows (#90)
On Windows, the compile command is never detected because `strings.TrimSuffix(goCmd, ".exe")` operates on the full path (e.g. `C:\...\compile.exe` → `C:\...\compile`) instead of the base name. The comparison `goCmdBase == "compile"` always fails. Fix: use `goCmdBase` instead of `goCmd` in TrimSuffix.
1 parent 91d91e1 commit bbc9d10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

failpoint-toolexec/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func main() {
3737
goCmd, buildArgs := os.Args[1], os.Args[2:]
3838
goCmdBase := filepath.Base(goCmd)
3939
if runtime.GOOS == "windows" {
40-
goCmdBase = strings.TrimSuffix(goCmd, ".exe")
40+
goCmdBase = strings.TrimSuffix(goCmdBase, ".exe")
4141
}
4242

4343
if strings.ToLower(goCmdBase) == "compile" {

0 commit comments

Comments
 (0)