Commit ee45d8e1 by Iwasaki Yudai

Replace `user.Current()` with `os.Getenv("HOME")`

`os/user.Current()` is not available on Darwin when a binary is cross
compiled from another platform.
See also: https://github.com/golang/go/issues/6376
1 parent 56ae9ab9
Showing with 1 additions and 6 deletions
......@@ -12,7 +12,6 @@ import (
"net/http"
"os"
"os/exec"
"os/user"
"strconv"
"strings"
"text/template"
......@@ -53,11 +52,7 @@ func New(options Options) (*App, error) {
prefString := []byte{}
prefPath := options.ProfileFile
if options.ProfileFile == DefaultProfileFilePath {
usr, err := user.Current()
if err != nil {
return nil, err
}
prefPath = usr.HomeDir + "/.gotty"
prefPath = os.Getenv("HOME") + "/.gotty"
}
if _, err = os.Stat(prefPath); os.IsNotExist(err) {
if options.ProfileFile != DefaultProfileFilePath {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!