From b873a72ac918deee69159003f6e2575ffbfff362 Mon Sep 17 00:00:00 2001 From: Andrew Po Date: Wed, 4 May 2016 18:01:25 +0300 Subject: [PATCH] Fixed panic in AddConfigPath --- util.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util.go b/util.go index b0903fb..2e6e56d 100644 --- a/util.go +++ b/util.go @@ -62,7 +62,11 @@ func absPathify(inPath string) string { if strings.HasPrefix(inPath, "$") { end := strings.Index(inPath, string(os.PathSeparator)) - inPath = os.Getenv(inPath[1:end]) + inPath[end:] + if end == -1 { + inPath = os.Getenv(inPath[1:]) + } else { + inPath = os.Getenv(inPath[1:end]) + inPath[end:] + } } if filepath.IsAbs(inPath) {