-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add LineBufferSize option field #85
Add LineBufferSize option field #85
Conversation
To support configuring the line buffer size a new field LineBufferSize is added to the cmd.Options struct. This allows configuring the line buffer size to the callers needs instead of relying on the DEFAULT_LINE_BUFFER_SIZE.
cmd.go
Outdated
// value DEFAULT_LINE_BUFFER_SIZE is usually sufficient, but if | ||
// ErrLineBufferOverflow errors occur, try increasing the size with this | ||
// field. | ||
LineBufferSize int |
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.
Let's make it unit
because it can't be negative (or zero). Then below, if options.LineBufferSize > 0 {
.
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'm unsure what you mean. uint
instead or change the name of the field? 🙏
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.
Use type uint
instead.
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 have updated the PR now. It does bring a, maybe only theoretical, implication. As OutputStream.SetLineBufferSize
accept an int
we need to cast it. Tihs could potentially bring an integer overflow as the range of uint
is larger than int
due to its unsigned nature. 🤔 WDYT, acceptable risk? Should we add a check?
Looks good. Re |
Released as v1.4.1. |
Thank you for your time in supporting this project 🙌🎉 |
To support configuring the line buffer size a new field
LineBufferSize
is addedto the
cmd.Options
struct. This allows configuring the line buffer size to thecallers needs instead of relying on the
DEFAULT_LINE_BUFFER_SIZE
.This fixes #66 .