pquerna / ffjson

faster JSON serialization for Go
Apache License 2.0
2.97k stars 234 forks source link

Add escaping html option #216

Closed croath closed 7 years ago

croath commented 7 years ago

Hello here,

It's a new method since Go 1.7, but I found no way to make it work for both 1.5/1.6/1.7. There's no preprocessor in Go so that I cannot do it during compiling. Checking version at runtime is a way but call methods via reflecting is quite slow. Even if the method won't be called with high frequency, it's still a little bit ugly.

I don't know if any other ways can help the pull request pass build under pre-1.7 version?

Thanks.

pquerna commented 7 years ago

I think i'm ok dropping support for go1.6 and bellow. All of my stuff is on modern versions.

pquerna commented 7 years ago

Thanks!

croath commented 7 years ago

Thanks, @pquerna !

Everything looks good now after my modifying the travis-ci build file. I didn't add test cases for the change because it's all running inside of the built-in encoder, tests seem to be unnessessary.