Delete findCWD method from util

It was unused
This commit is contained in:
bogem 2016-08-30 19:33:05 +05:00
parent 6953393ddd
commit d120ea2ddb

29
util.go
View file

@ -68,10 +68,10 @@ func absPathify(inPath string) string {
p, err := filepath.Abs(inPath)
if err == nil {
return filepath.Clean(p)
} else {
jww.ERROR.Println("Couldn't discover absolute path")
jww.ERROR.Println(err)
}
jww.ERROR.Println("Couldn't discover absolute path")
jww.ERROR.Println(err)
return ""
}
@ -107,29 +107,6 @@ func userHomeDir() string {
return os.Getenv("HOME")
}
func findCWD() (string, error) {
serverFile, err := filepath.Abs(os.Args[0])
if err != nil {
return "", fmt.Errorf("Can't get absolute path for executable: %v", err)
}
path := filepath.Dir(serverFile)
realFile, err := filepath.EvalSymlinks(serverFile)
if err != nil {
if _, err = os.Stat(serverFile + ".exe"); err == nil {
realFile = filepath.Clean(serverFile + ".exe")
}
}
if err == nil && realFile != serverFile {
path = filepath.Dir(realFile)
}
return path, nil
}
func unmarshallConfigReader(in io.Reader, c map[string]interface{}, configType string) error {
buf := new(bytes.Buffer)
buf.ReadFrom(in)