Closed fspinolo closed 5 months ago
Unfortunately, I don't see any boolean values in the provided database. I do see strings with values like "true"
and ""
. Similar to encoding/json
and other libraries, this library does not support decoding a string to a boolean. Although it is probably too late for them to change it, it would be nice if the database used the correct types when encoding the data.
Thanks for confirming the issue! I will take it up with IPInfo.
I am using this library to read a sample mmdb provided by IPInfo at https://github.com/ipinfo/sample-database/blob/main/Privacy%20Detection/privacy_detection_sample.mmdb.
The records contain several boolean fields, and use an empty value to signify "false". This fails with
maxminddb: cannot unmarshal into type bool
. I would expect it to treat it as a false value (the zero value for a bool in Go).Can decoding be updated to support this case?