mirror of
https://github.com/yudai/gotty.git
synced 2026-01-24 10:16:10 +01:00
generate falgs based on struct options instead of defining them externally
This commit is contained in:
parent
c4ed7bc415
commit
d71e2fcfa8
6 changed files with 218 additions and 231 deletions
13
utils/path.go
Normal file
13
utils/path.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func ExpandHomeDir(path string) string {
|
||||
if path[0:2] == "~/" {
|
||||
return os.Getenv("HOME") + path[1:]
|
||||
} else {
|
||||
return path
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue