annie-miqt/downloadsdir_unix.go

18 lines
307 B
Go

// +build !windows
package main
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")
}