Files
kopia/internal/tempfile/tempfile_unix_nonlinux.go
Julio López e3fc6e012d refactor(general): leverage os.CreateTemp (#4513)
* use `os.CreateTemp` in `tempfile.CreateAutoDelete`
* refactor `TestTempFile`: add `VerifyTempfile` test helper
* add test for `createUnixFallback`
* rename function to `tempfile.CreateAutoDelete`
* remove the `dir` parameter to `tempfile.CreateAutoDelete`,
  only an empty string was passed, apart from test cases.
* guard against panic in TestShadowCopy
2025-04-22 20:55:11 -07:00

14 lines
284 B
Go

//go:build freebsd || darwin || openbsd
// +build freebsd darwin openbsd
package tempfile
import (
"os"
)
// CreateAutoDelete creates a temporary file that does not need to be explicitly removed on close.
func CreateAutoDelete() (*os.File, error) {
return createUnixFallback()
}