feat: initial goget release — modern IPv6-first download utility

This commit is contained in:
2026-06-26 21:21:58 +02:00
commit 53db81e1f7
147 changed files with 45931 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
//go:build linux || freebsd
// +build linux freebsd
package output
import (
"os"
"path/filepath"
)
// CreateTempFile creates a temporary file in the specified directory for atomic writes.
func CreateTempFile(dir, pattern string) (*os.File, error) {
return os.CreateTemp(dir, pattern)
}
// AtomicReplace atomically renames a temporary file to its final destination.
func AtomicReplace(tempPath, finalPath string) error {
return os.Rename(tempPath, finalPath)
}
// CleanupTempFile removes a temporary file at the given path.
func CleanupTempFile(path string) error {
return os.Remove(path)
}
// GetTempDir returns the directory portion of the given path for temporary file placement.
func GetTempDir(path string) string {
return filepath.Dir(path)
}