gravwell / gcfg

read INI-style configuration files into Go structs; supports user-defined types and subsections
https://gopkg.in/gcfg.v1
Other
0 stars 4 forks source link

errors suck when a bad key is put into a config block #10

Closed kris-watts-gravwell closed 1 year ago

kris-watts-gravwell commented 1 year ago

What are the steps to reproduce this issue?

  1. stick something like Foobar=stuff in s3.conf for the S3 ingester

What happens?

you get the error

failed to get configuration Config file "/tmp/s3/s3.conf" returned error warning:                                                                                                                                                                                                
can't store data at section "Bucket", subsection "default"

What were you expecting to happen?

"Cannot store "Foobar" into section Bucket, subsection default.

Any other comments?

we have the key value, the error should include it.

What versions of software are you using?

5.1.2-4

kris-watts-gravwell commented 1 year ago

https://github.com/gravwell/gcfg/pull/12

dmullis commented 4 months ago

Would you be able to cut a release that includes the fix for this? It is not currently available to clients over the web via specification in go.mod.

I'd like to use gcfg in https://github.com/blampe/goat, but this would bite users hard.

Guess I could add a vendor/ directory to the goat sources, but that's a bit ugly.

kris-watts-gravwell commented 4 months ago

new release cut as v1.2.9.

For future reference you can always pin a specific commit using go.mod. For example, to grab and pin the latest on this repo without relying on releases you can run:

go get -u github.com/gravwell/gcfg/v1@40c40a48733e7692b45cc5121af5b3596b9a3ce6