Closed mmcgrana closed 12 years ago
Since when is an environment var a number? Sounds like an API bug.
On Jun 21, 2012, at 8:01 PM, Mark McGranaghanreply@reply.github.com wrote:
$ hk env -a ion-mark json: cannot unmarshal number into Go value of type string $ heroku config -a ion-mark | head -n 1 === Config Vars for ion-mark ... $ hk version 0.6
Reply to this email directly or view it on GitHub: https://github.com/kr/hk/issues/5
@bmizerany can you elaborate? Would data like this give the JSON lib trouble?
$ curl -nis https://api.heroku.com/apps/ion-mark/config_vars | json | head -n 4
{
"NO_GPG": "1",
"ENABLE_VOLUME_DESTRUCTION": "1",
"ENABLE_LOCAL_SHEPHERD": "1",
Is a value is a number (I.e digits not in parens) and the field it is in matches a name of a field in the struct that is of type string, and there are no hints to the decoder to treat the field as a string unconditionally, then yes, the decoder will return an error.
The struct we fill in hk id a map of string to string, so an integer type in the JSON would cause this error.
I am suggesting the error lies in the API because an environment variable is never anything other than a string.
Do you have the rest of the JSON? It looks cut off.
I could be a bug on our end but I think it's unlikely.
On Jun 21, 2012, at 9:53 PM, Mark McGranaghanreply@reply.github.com wrote:
@bmizerany can you elaborate? Would data like this give the JSON lib trouble?
$ curl -nis https://api.heroku.com/apps/ion-mark/config_vars | json | head -n 4 { "NO_GPG": "1", "ENABLE_VOLUME_DESTRUCTION": "1", "ENABLE_LOCAL_SHEPHERD": "1",
Reply to this email directly or view it on GitHub: https://github.com/kr/hk/issues/5#issuecomment-6500593
Ahh interesting - I found it:
$ curl -nis https://api.heroku.com/apps/ion-mark/config_vars | json | grep INC
"ION_INCARNATION": 1340308737,
I will investigate with API. Thanks!
Man. I'm impressed I got that point across while at the GoSF drink-up while on an iPhone. :)