You can use this library: https://godoc.org/github.com/mitchellh/go-homedir#Expand
On Wednesday, December 28, 2016 at 8:22:06 AM UTC-5, Aurélien Desbrières wrote: > > As explain ~/ in golang <https://github.com/golang/go/issues/18443> , I > am trying to request the user to cat a file with a gocat program. > > The point is that if the user tell to the terminal the full address, > /home/user/file, the program works, but if the user use ~/file the program > brokes. > > How can I use Golang to use ~/ in terminal request? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.