Migration: go 1.13

This commit is contained in:
Dreamacro
2019-09-04 23:26:20 +09:00
parent 0d51877fcd
commit 9e0bd62790
7 changed files with 30 additions and 33 deletions

View File

@ -2,7 +2,6 @@ package constant
import (
"os"
"os/user"
P "path"
)
@ -16,16 +15,9 @@ type path struct {
}
func init() {
currentUser, err := user.Current()
var homedir string
homedir, err := os.UserHomeDir()
if err != nil {
dir := os.Getenv("HOME")
if dir == "" {
dir, _ = os.Getwd()
}
homedir = dir
} else {
homedir = currentUser.HomeDir
homedir, _ = os.Getwd()
}
homedir = P.Join(homedir, ".config", Name)