Closed stephens2424 closed 4 years ago
Thanks for the feedback The parsing code is part of the Go source code and hence I'm not sure if this is a feature or bug.
Thanks for the response. It looks like the reflect package handles the trailing spaces. Checking out the reflect source, it looks like it uses a break out of that loop as well, like with my change. I can't say I understand why the difference exists, though, so maybe there's something I'm missing, but maybe these data points help.
This makes sense, thanks for the looking into it more detailed. The tests are also passing so there is no issues going forward. I merged your change and will release a new version.
A trailing space in a struct tag, like
`json:"foo" `
, causes the parse result to benil, nil
. I would expect the trailing space to be ignored.For example: https://play.golang.org/p/NgGis4SV2mY
I'm filing this issue for tracking, but I also have a patch to submit.