This commit is contained in:
Brad Fitzpatrick 2013-08-28 13:09:26 -07:00
commit 70d1bfd635
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ func HomeDir() string {
return os.Getenv("HOME")
}
// Username returns the current user's username, as
// reported by the relevant environment variable.
func Username() string {
if runtime.GOOS == "windows" {
return os.Getenv("USERNAME")