func homeDir() (string, error) {
	if h := os.Getenv("HOME"); h != "" {
		return h, nil
	}
	h, err := exec.Command("sh", "-c", "eval echo ~$USER").Output()
	if err == nil && len(h) > 0 {
		return strings.TrimSpace(string(h)), nil
	}
	return "", fmt.Errorf("home directory not found for current user")
}
func homeDir() (string, error) {
	if h := os.Getenv("HOME"); h != "" {
		return h, nil
	}
	h, err := exec.Command("sh", "-c", "eval echo ~$USER").Output()
	if err == nil && len(h) > 0 {
		return strings.TrimSpace(string(h)), nil
	}
	return "", fmt.Errorf("home directory not found for current user")
}
func homeDir ( ) ( string , error ) { if h := os . Getenv ( " " ) ; h != " " { return h , nil } h , err := exec . Command ( " " , " " , " " ) . Output ( ) if err == nil && len ( h ) > 0 { return strings . TrimSpace ( string ( h ) ) , nil } return " " , fmt . Errorf ( " " ) }
// find unix home directory
find unix home directory