I have a program that accepts a destination folder where files will be created. My program should be able to handle absolute paths as well as relative paths. My problem is t
I know this is an old question but there is another option now. You can use go-homedir to expand the tidle to the user's homedir:
myPath := "~/.ssh" fmt.Printf("path: %s; with expansion: %s", myPath, homedir.Expand(myPath))