You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The os package code seems to be almost the very same. So, is this package still relevant? Or is the std lib os still using cgo somewhere?
From package os.
func UserHomeDir() (string, error) {
env, enverr := "HOME", "$HOME"
switch runtime.GOOS {
case "windows":
env, enverr = "USERPROFILE", "%userprofile%"
case "plan9":
env, enverr = "home", "$home"
}
if v := Getenv(env); v != "" {
return v, nil
}
// On some geese the home directory is not always defined.
switch runtime.GOOS {
case "android":
return "/sdcard", nil
case "ios":
return "/", nil
}
return "", errors.New(enverr + " is not defined")
}
The text was updated successfully, but these errors were encountered:
Also the primary motivation for this package (from README.md) what that os/user was using cgo on Darwin. But since Go 1.20 this is no longer the case (see golang/go@185766d) and os/user even exposes a osusergo build tag to force avoiding cgo.
i went down this rabbit hole of finding this repo after seeing it in autocomplete 😅. I would appreciate if this repo was archived so that it's more obvious that this shouldn't be used
The os package code seems to be almost the very same. So, is this package still relevant? Or is the std lib os still using cgo somewhere?
From package os.
The text was updated successfully, but these errors were encountered: