Try to use absolute path to config file.
import "filepath"
configPath := filepath.Abs(filepath.Clean(*config)) cfg, err :=
ini.Load(configPath)
On 26.02.2019 10:57, Natxo Asenjo 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.
Scratching my head ...
--
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
<mailto:golang-nuts+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
-------------------------------
The information in this email is
confidential and may be legally privileged, it may contain information that
is confidential in CodiLime Sp. z o. o. It is intended solely for the
addressee. Any access to this email by third parties is unauthorized. If
you are not the intended recipient of this message, any disclosure,
copying, distribution or any action undertaken or neglected in reliance
thereon is prohibited and may result in your liability for damages.
--
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.