Skip to content

Commit 3826be3

Browse files
qjcgsagikazarmark
authored andcommitted
Simplify $HOME prefix check
1 parent ce53404 commit 3826be3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ func insensitiviseMap(m map[string]interface{}) {
9191
func absPathify(inPath string) string {
9292
jww.INFO.Println("Trying to resolve absolute path to", inPath)
9393

94-
if strings.HasPrefix(inPath, "$HOME") &&
95-
(len(inPath) == 5 || inPath[5] == os.PathSeparator) {
94+
if inPath == "$HOME" || strings.HasPrefix(inPath, "$HOME"+string(os.PathSeparator)) {
9695
inPath = userHomeDir() + inPath[5:]
9796
}
9897

0 commit comments

Comments
 (0)