Skip to content

Commit

Permalink
check HOME and USER variables on startup
Browse files Browse the repository at this point in the history
Related #108
  • Loading branch information
gokcehan committed Aug 27, 2018
1 parent 266a583 commit 5e67147
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions os.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ func init() {
u, err := user.Current()
if err != nil {
log.Printf("user: %s", err)
if os.Getenv("HOME") == "" {
log.Print("$HOME variable is empty or not set")
}
if os.Getenv("USER") == "" {
log.Print("$USER variable is empty or not set")
}
}
gUser = u

Expand Down

0 comments on commit 5e67147

Please sign in to comment.