20 lines
No EOL
285 B
Go
20 lines
No EOL
285 B
Go
//go:build !linux
|
|
|
|
package memfile
|
|
|
|
import (
|
|
"os"
|
|
|
|
"git.urbach.dev/cli/q/src/global"
|
|
)
|
|
|
|
// New creates a new anonymous in-memory file.
|
|
func New(name string) (*os.File, error) {
|
|
pattern := "*"
|
|
|
|
if global.OS == "windows" {
|
|
pattern = "*.exe"
|
|
}
|
|
|
|
return os.CreateTemp("", pattern)
|
|
} |