Skip to content
Snippets Groups Projects
Commit 065ef26b authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Add a comment for ExpandTilde.

parent 09b0c363
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -28,6 +28,7 @@ func setDefaults() { ...@@ -28,6 +28,7 @@ func setDefaults() {
viper.SetDefault("validateTLSCertificate", true) viper.SetDefault("validateTLSCertificate", true)
} }
// Expand ~ and ~user for a given path.
func ExpandTilde(path string) string { func ExpandTilde(path string) string {
re := regexp.MustCompile("^~([^/]*)(/.*)") re := regexp.MustCompile("^~([^/]*)(/.*)")
if m := re.FindStringSubmatch(path); len(m) > 0 { if m := re.FindStringSubmatch(path); len(m) > 0 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment