Panic when using float64 value for language version instead of string in yml file
srishanbhattarai opened this issue · 6 comments
For example, in .travis.yml
, the following works:
language: go
go: "1.9"
# this works
However, if I unquote the "1.9"
then previs
will panic even though this is still a valid travis config.
language: go
go: 1.9
# this panics
I traced the offending section to:
Lines 39 to 56 in 9f0ed56
As noted in the Go documentation for the Index
method.
func (v Value) Index(i int) Value
Index returns v's i'th element. It panics if v's Kind is not Array, Slice, or String or i is out of range.
Thank you for your issue, it helps a lot.
The biggest improvment point that can be done about the project is the parsing of the configuration .travis.yml
.
I'm currently thinking/looking for a good solution to implement.
Any thought are welcome :)
I think you would want to get rid of reflections entirely for a long-term solution? 😄 Or even if you do want to use it, it should be a separate package with high test coverage. Do let me know if you need contributions to help you with anything.
Thanks you for your help, I was thinking about creating an external package with the only goal to read the travis config and transform it in readable format in go to facilitate and be the closest possible to travis real config. I let you know with pleasure if I encounter any problem or any discussion we may have to improve Previs :).
I was thinking the same and I've pretty much got it working already! I'll send a PR soon 😄
Nice! Im looking forward to see it :)
Ref: #4