package fsutilimport ()// CurrentUser allows for unit test error injection.varCurrentUserfunc() (*user.User, error) = user.Current// GetHome finds the home directory of a specified user. When given an empty// string, it finds the home directory of the current user.func ( string) (string, error) {if == "" {// Use $HOME as override if we are looking for the home of the current // variable. := os.Getenv(env.HOME)if != "" {returnstrings.TrimRight(, pathSep), nil } }// Look up the user.var *user.Uservarerrorif == "" { , = CurrentUser() } else { , = user.Lookup() }if != nil {return"", fmt.Errorf("can't resolve ~%s: %s", , .Error()) }returnstrings.TrimRight(.HomeDir, "/"), nil}
The pages are generated with Goldsv0.2.8-preview. (GOOS=darwin GOARCH=arm64)