Skip to content

PR to #21#23

Open
flrdv wants to merge 5 commits intoromshark:mainfrom
flrdv:main
Open

PR to #21#23
flrdv wants to merge 5 commits intoromshark:mainfrom
flrdv:main

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?


// 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

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