gof3r/options.go
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")
}
// find unix home directory