Closed stokito closed 2 years ago
Can we avoid such double conversion? Will you accept a PR with this?
If it's correct, sure.
@stokito It is already an int, so there is not double conversion.
There is no guarantee you have the original text. Only strings have that guarantee.
The
StringCvt
function contains a code:That means that internally in the
i.Int()
the unerlying value will be converted to integer but then immoderately it will be converted back to a string by thestrconv.FormatInt()
. Can we avoid such double conversion? Will you accept a PR with this?In my case I expect the int field to be a valid and to be honest I would be just happy to get it as a byte slice. Even for string values I would like to get raw bytes including quotes and then reuse it and write as is into a http response. As far I see I need something like
i.tape.stringByteAt(i.cur, i.tape.Tape[i.off])
but not sure if it will work for int fields.