-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
To fix unexpected errors of type: ``` [signal: killed] FAIL: testscripts/myecho.txt:1: unexpected command failure ``` Fixes #200
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= | ||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= | ||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= | ||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= | ||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build unix && !darwin | ||
// +build unix,!darwin | ||
|
||
package testscript | ||
|
||
import "golang.org/x/sys/unix" | ||
Check failure on line 6 in testscript/clonefile.go GitHub Actions / test (1.19.x, ubuntu-latest)
|
||
|
||
// cloneFile creates to as a hard link to the from file. | ||
func cloneFile(from, to string) error { | ||
return os.Link(from, to) | ||
Check failure on line 10 in testscript/clonefile.go GitHub Actions / test (1.19.x, ubuntu-latest)
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package testscript | ||
|
||
import "golang.org/x/sys/unix" | ||
|
||
// cloneFile clones the file from to the file to. | ||
func cloneFile(from, to string) error { | ||
return unix.Clonefile(from, to, 0) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build !unix | ||
// +build !unix | ||
|
||
package testscript | ||
|
||
import "os" | ||
Check failure on line 6 in testscript/clonefile_other.go GitHub Actions / test (1.19.x, windows-latest)
Check failure on line 6 in testscript/clonefile_other.go GitHub Actions / test (1.19.x, windows-latest)
Check failure on line 6 in testscript/clonefile_other.go GitHub Actions / test (1.20.x, windows-latest)
|
||
|
||
// We don't want to use hard links on Windows, as that can lead to "access denied" errors when removing. | ||
func cloneFile(from, to string) error { | ||
return fmt.Errorf("unavailable") | ||
Check failure on line 10 in testscript/clonefile_other.go GitHub Actions / test (1.19.x, windows-latest)
Check failure on line 10 in testscript/clonefile_other.go GitHub Actions / test (1.19.x, windows-latest)
Check failure on line 10 in testscript/clonefile_other.go GitHub Actions / test (1.20.x, windows-latest)
|
||
} |