-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line protocol integer #3526
Line protocol integer #3526
Conversation
@@ -488,8 +488,9 @@ func isNumeric(b byte) bool { | |||
// scanNumber returns the end position within buf, start at i after | |||
// scanning over buf for an integer, or float. It returns an | |||
// error if a invalid number is scanned. | |||
func scanNumber(buf []byte, i int) (int, []byte, error) { | |||
func scanNumber(buf []byte, i int) (int, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change as the []byte
of the return was ignored and only called in one spot.
+1 |
1 similar comment
+1 |
As noted in #3526 writing integer values now requires a tailing i. This commit updates the README appropriately
@corylanou looks like there's a minor mismatch with the original #3519 from @pauldix.
@mjdesa got a parser error, not a silent dropping of the fractional part. Either one can be the true implementation, but let's agree on the right one before we document. |
@beckettsean correct. This was a decision based on conversation that I had with @pauldix and we decided to just return an error for now. If the community feels strongly, we can add more code around it to just truncate it. In general, it feels really odd that |
To me, adding an |
Thanks for the context, @corylanou. I agree with you and Paul, let's leave it as is for now, and @mjdesa please document it as such. If someone opens an issue to complain about the writes throwing errors instead of silently recasting and truncating we can have the discussion then. |
Line protocol now requires a trailing
i
for the type to be written as in int.