Advertisement
FlyFar

home_windows.go

Dec 17th, 2023
891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.19 KB | Cybersecurity | 0 0
  1. package main
  2.  
  3. import (
  4.     "os"
  5. )
  6.  
  7. func GetHomeDir() string {
  8.     home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
  9.  
  10.     if home == "" {
  11.         home = os.Getenv("USERPROFILE")
  12.     }
  13.  
  14.     return home
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement