From 89b9345aee94731c86e8ee34fc0abda8d6702cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 6 May 2023 08:45:56 +0100 Subject: [PATCH] CI: go back to macos-latest Now that it seems we found a fix to #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. --- clonefile.go | 2 +- clonefile_darwin.go | 2 +- clonefile_other.go | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/clonefile.go b/clonefile.go index dd2467d4..c841d67d 100644 --- a/clonefile.go +++ b/clonefile.go @@ -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) } diff --git a/clonefile_darwin.go b/clonefile_darwin.go index c0e7a9e6..79645bc2 100644 --- a/clonefile_darwin.go +++ b/clonefile_darwin.go @@ -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) } diff --git a/clonefile_other.go b/clonefile_other.go index 5682a927..d66b841b 100644 --- a/clonefile_other.go +++ b/clonefile_other.go @@ -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") }