On Tue, Feb 26, 2019 at 10:58 AM Natxo Asenjo <natxo.ase...@gmail.com> wrote:
> > hi, > > On Tuesday, February 26, 2019 at 10:51:28 AM UTC+1, Sebastien Binet wrote: >> >> from the compilation error, it would seem kingpin.Flag...ExistingFile() >> returns a *string, not a string. >> so these lines: >> fmt.Printf("%v, %s, %T\n", config, config, config) >> cfg, err := ini.Load(config) >> should be replaced with: >> fmt.Printf("%v, %s, %T\n", *config, *config, *config) >> cfg, err := ini.Load(*config) >> >> Thanks! > > I had indeed already tried that but alas: > > $ go run kk.go --config api.conf > , , string > open : no such file or directory > exit status 1 > > after dereferencing config, it appears to be empty. > > it appears that defining the config variable and the other variables globally does not work. If I define the url/api/user/pwd in main(), then I can use the config variable as expected (indeed with a pointer *config). Thanks for the tip. -- regards, natxo -- 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.