path.go 217 B

123456789101112131415161718
  1. package utils
  2. import (
  3. "os"
  4. "runtime"
  5. )
  6. var getOS = func() string {
  7. return runtime.GOOS
  8. }
  9. func GetHomePath() string {
  10. if getOS() == "windows" {
  11. return os.Getenv("USERPROFILE")
  12. }
  13. return os.Getenv("HOME")
  14. }