Skip to content
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

PR to #21 #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

PR to #21 #23

wants to merge 5 commits into from

Conversation

flrdv
Copy link

@flrdv flrdv commented Dec 16, 2023

renamed walker closure's named return value to exit instead of err, as considered in #21

@romshark romshark self-assigned this Dec 16, 2023
Copy link
Owner

@romshark romshark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to update the documentation as well by adding the following sentence where relevant:

If fn returns true, <FuncName> immediately stops and returns ErrorCodeCallback.

@flrdv
Copy link
Author

flrdv commented Dec 16, 2023

It would make sense to update the documentation as well by adding the following sentence where relevant:

If fn returns true, <FuncName> immediately stops and returns ErrorCodeCallback.

Should those be in docstrings or distributed across the code by itself?

@romshark
Copy link
Owner

Should those be in docstrings or distributed across the code by itself?

In the doc comments of the individual functions/methods, like:

// ScanOne calls fn for every encountered value including objects and arrays.
// When an object or array is encountered fn will also be called for each of its
// member and element values.
// If fn returns true, ScanOne immediately stops and returns ErrorCodeCallback.
//
// ...

@romshark romshark self-requested a review December 17, 2023 08:39
@flrdv
Copy link
Author

flrdv commented Dec 18, 2023

Any updates?

@@ -2,7 +2,7 @@ package jsonnum

// ReadNumber returns the index of the end of the number value
// and err=true if a syntax error was encountered.
func ReadNumber[S ~string | ~[]byte](s S) (trailing S, err bool) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This boolean actually indicates whether there was an error, please don't change it in internal/jsonnum

scan.go Outdated Show resolved Hide resolved
scan.go Outdated Show resolved Hide resolved
flrdv and others added 2 commits December 19, 2023 07:41
Co-authored-by: Roman Sharkov <roman.scharkov@gmail.com>
Co-authored-by: Roman Sharkov <roman.scharkov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants