You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/02/06 15:22:25 UTC

[GitHub] rob05c edited a comment on issue #3304: Golang endpoints should accept "string integers"

rob05c edited a comment on issue #3304: Golang endpoints should accept "string integers"
URL: https://github.com/apache/trafficcontrol/issues/3304#issuecomment-461062084
 
 
   >Do you think that it would be possible to avoid using `JSONIntStr` and instead replace `"[0-9]*"` with the number inside the quotes before decoding? Would that break anything?
   
   Yes, that would definitely break things. E.g. `{"foo": "bar {\"foo\": 123}"}`. The only way to do it correctly, would be to actually parse the JSON. So yeah, you could decode/reencode/decode, but that's obviously way too slow. Not too mention the code to recursively iterate over the `map[string]interface{}` for every endpoint.
   
   A custom type with a custom Unmarshal func is the only fast/small solution in Go, as far as I can see.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services