Codebase list golang-github-spf13-viper / 46a61e6
Fixes #1062 Séra Zoltán authored 3 years ago Márk Sági-Kazár committed 2 years ago
1 changed file(s) with 1 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
9494 inPath = userHomeDir() + inPath[5:]
9595 }
9696
97 if strings.HasPrefix(inPath, "$") {
98 end := strings.Index(inPath, string(os.PathSeparator))
99
100 var value, suffix string
101 if end == -1 {
102 value = os.Getenv(inPath[1:])
103 } else {
104 value = os.Getenv(inPath[1:end])
105 suffix = inPath[end:]
106 }
107
108 inPath = value + suffix
109 }
97 inPath = os.ExpandEnv(inPath)
11098
11199 if filepath.IsAbs(inPath) {
112100 return filepath.Clean(inPath)