What's wrong with a library? This particular library is used by vagrant and dozens of other software projects, it's cross platform and handles all the edge cases.
Never relying on 3rd party libraries is a very inefficient way to write software. Seems like even just copying the code would be more productive than writing it from scratch. It has a very permissive license: https://github.com/mitchellh/go-homedir/blob/master/LICENSE. On Thursday, December 29, 2016 at 8:41:03 AM UTC-5, Aurélien Desbrières wrote: > > Oh so that is not an official stuff from go but an outside library ~_~ > Is there any ways more "official" to do that? > > On Thursday, December 29, 2016 at 7:17:02 AM UTC+1, Aurélien Desbrières > wrote: >> >> That sounds good. I will try it and tell you back. Thanks >> >> On Thu, Dec 29, 2016, 5:02 AM Caleb Doxsey wrote: >> >>> 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.