Skip to content

Commit

Permalink
Replace $HOME with os.UserHomeDir()
Browse files Browse the repository at this point in the history
os.UserHomeDir() was introduced in Go 1.12.

Update #222
  • Loading branch information
fhs authored and rjkroege committed Sep 26, 2019
1 parent 0e73df1 commit d3bad36
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions acme.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func main() {
}()
}

// TODO(fhs): This is not very portable.
// See https://github.com/rjkroege/edwood/issues/222
home = os.Getenv("HOME")
var err error
home, err = os.UserHomeDir()
if err != nil {
log.Fatalf("could not get user home directory: %v", err)
}
acmeshell = os.Getenv("acmeshell")
p := os.Getenv("tabstop")
if p != "" {
Expand Down

0 comments on commit d3bad36

Please sign in to comment.