MCPcopy Create free account
hub / github.com/SpectoLabs/hoverfly / expandHomeDirectory

Function expandHomeDirectory

hoverctl/cmd/bash_completion.go:104–114  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

102}
103
104func expandHomeDirectory(path string) (string, error) {
105 if len(path) == 0 || path[0] != '~' {
106 return path, nil
107 }
108
109 usr, err := user.Current()
110 if err != nil {
111 return "", err
112 }
113 return filepath.Join(usr.HomeDir, path[1:]), nil
114}

Callers 1

determineSymlinkLocationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected