On Fri, 30 Dec 2016 06:12:46 +0000 Aurélien DESBRIÈRES <aurelien.desbrie...@gmail.com> wrote:
> > > The original code is https://play.golang.org/p/CTbhTC50eE > > > It is write to works as: > > > > > > go run gocat.go > > > > > > Here is how it works at this time. > > > > > > $ go run gocat.go > > > Which file would you like to read?: ~/bob > > > 2016/12/29 17:10:19 my program broken > > > exit status 1 > > > > > $ go run gocat3.go > > Which file would you like to read?: /home/aurelien/bob > > hmm hmm > > > > Based on Jan's reply, https://play.golang.org/p/-7NUaJwoOf is a > > little more safe. > > > What do you mean by more safe? It won't expand the tilde in strings where the tilde is not followed by a slash or end of string, like "~blah" -- since "~blah" must be expanded to the home directory of the user which has login name "blah" (or the results are undefined if there's no such user; the dash and bash shells would leave the string unexpanded). -- 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.