Skip to content

Commit

Permalink
CI: go back to macos-latest
Browse files Browse the repository at this point in the history
Now that it seems we found a fix to rogpeppe#200, there is no reason to stick
to macos-11, which will likely be deprecated soon.

Update actions/setup-go to its latest version as well.
The new version uses caching by default, which we do not need.

While here, tidy up the cloneFile docs a bit.
  • Loading branch information
mvdan authored and ldemailly committed Sep 6, 2024
1 parent fd1755f commit 89b9345
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clonefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package testscript

import "os"

// cloneFile creates to as a hard link to the from file.
// cloneFile makes a clone of a file via a hard link.
func cloneFile(from, to string) error {
return os.Link(from, to)
}
2 changes: 1 addition & 1 deletion clonefile_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package testscript

import "golang.org/x/sys/unix"

// cloneFile clones the file from to the file to.
// cloneFile makes a clone of a file via MacOS's `clonefile` syscall.
func cloneFile(from, to string) error {
return unix.Clonefile(from, to, 0)
}
4 changes: 3 additions & 1 deletion clonefile_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ package testscript

import "fmt"

// We don't want to use hard links on Windows, as that can lead to "access denied" errors when removing.
// cloneFile does not attempt anything on Windows, as hard links on it have
// led to "access denied" errors when deleting files at the end of a test.
// We haven't tested platforms like plan9 or wasm/wasi.
func cloneFile(from, to string) error {
return fmt.Errorf("unavailable")
}

0 comments on commit 89b9345

Please sign in to comment.