From 713e81daef9b01f24c4120c5e3e34d242f226797 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 May 2026 23:24:42 +0300 Subject: chore: bump go.mod from go 1.25.0 to go 1.26.0 Update the Go version directive to match the local runtime (go1.26.3). Also includes go mod tidy cleanup and unrelated test improvements. --- integrationtests/cli_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'integrationtests') diff --git a/integrationtests/cli_test.go b/integrationtests/cli_test.go index 5567ad1..017250e 100644 --- a/integrationtests/cli_test.go +++ b/integrationtests/cli_test.go @@ -6,11 +6,12 @@ package integrationtests import ( "os" "os/exec" + "path/filepath" "strings" "testing" ) -// buildBinary builds the gt binary to a temporary location. +// buildBinary builds the gt binary to a temporary location unique to each test. func buildBinary(t *testing.T) string { t.Helper() @@ -20,18 +21,17 @@ func buildBinary(t *testing.T) string { projectRoot = "/home/paul/git/gt" } - buildCmd := exec.Command("go", "build", "-o", "/tmp/gt-test", "./cmd/gt") + // Use t.TempDir() so each test gets its own binary path; Go cleans up automatically. + tmpDir := t.TempDir() + binaryPath := filepath.Join(tmpDir, "gt-test") + + buildCmd := exec.Command("go", "build", "-o", binaryPath, "./cmd/gt") buildCmd.Dir = projectRoot if err := buildCmd.Run(); err != nil { t.Fatalf("build failed: %v", err) } - t.Cleanup(func() { - // Explicitly ignore error return from os.Remove during cleanup - _ = os.Remove("/tmp/gt-test") - }) - - return "/tmp/gt-test" + return binaryPath } // TestCLIVersion tests that the version command works correctly. -- cgit v1.2.3