2025-01-24 11:46:12 +13:00
|
|
|
// +build !windows
|
2020-02-27 17:45:37 +08:00
|
|
|
|
2025-01-24 11:46:12 +13:00
|
|
|
package main
|
2020-02-27 17:45:37 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os/user"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DefaultDownloadsFolder returns the system-specific user downloads folder.
|
|
|
|
func DefaultDownloadsFolder() string {
|
|
|
|
whoami, err := user.Current()
|
|
|
|
if err != nil {
|
|
|
|
return "."
|
|
|
|
}
|
|
|
|
return filepath.Join(whoami.HomeDir, "Downloads")
|
|
|
|
}
|