Closed rafecolton closed 10 years ago
Hmm. I need to check that out.
@rafecolton Can you try this from master?
I'm still experiencing the same issue. I've been investigating a bit and have the following data points:
toml
for config and includes a []string
element. Using the same version of BurntSushi/toml
, I am unable to get the same issue.confd.toml
, the decoder is able to successfully retrieve the 0th index from the slice - it fails on the 1st index datav.Index(1)
. This is especially odd.rv.IsNil()
returns true) whereas when confd.toml
gets parsed, it does not. Removing the rv.IsNil()
condition so that rv.Set(reflect.MakeSlice(rv.Type(), sliceLen, sliceLen))
gets executed results in a successful confd -onetime
run.BurntSushi/toml
- not really relevant, but amusing :smile: Still not sure what the cause is, but I will continue to investigate...
Hooray! Found the problem.
It looks like the issue is somewhere in the toml.DecodeFile()
function - I have submitted a pull request for Confd (https://github.com/kelseyhightower/confd/pull/61) that reads in the file manually first and then uses toml.Decode()
to parse the raw bytes. This is the strategy I employ in Bob, mainly because the toml.Decode()
method was the first one in the README :trollface:
I tested it in the same case as above and can confirm that it works.
I will submit a bug report to BurntSushi once I get to work today, but for new, a few more precious hours of sleep!
issue can be closed per #61 (?)
With both
0.3.0-beta1
and0.3.0
, I get the issue described below. What am I doing wrong?This works
This, on the other hand...
...produces this: