rob05c commented 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:
[email protected]


With regards,
Apache Git Services

Reply via email to