-
Notifications
You must be signed in to change notification settings - Fork 270
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
CORS: allow users to disable preflight caching #250
base: main
Are you sure you want to change the base?
CORS: allow users to disable preflight caching #250
Conversation
The downside of using |
Thank you for sharing your perspective! From my understanding, using pointer properties offers clarity about the ability to leave a value empty or unset. It helps indicate when a property is intentionally left nil, providing a clear distinction between an intentionally empty value and a default or zero value. While I acknowledge the downsides you mentioned, I'll keep exploring and learning. If there are specific best practices you recommend regarding pointer properties in Go, I'd love to hear more!" |
No worries. We're all learning, I as well.
Under the assumption that |
The isn't entirely accurate, as most users tend to inspect the underlying code of a function they wish to use. They often aim to minimize the time needed to comprehend it. In my view, a quick glance at the We aim for the user to be able to set the header to a value, 0, or leave it unset. In my view, this functionality is better described using a pointer. |
Users who wish to study the implementation would, of course, see how it's implemented. But the point of information hiding in library design is that users can then afford to be oblivious to the implementation.
That's what documentation is about, isn't it? Users shouldn't have to study the source code of a library in order to know how to use it. See Rob Pike's Documentation is for users proverb.
This comment suggests to me that you haven't studied my approach closely enough... 🤔
|
No feedback from maintainers in more than three months... Is this project still maintained? |
What type of PR is this? (check all applicable)
Description
This PR follows a different approach (from #249 ) by changing the property to a pointer integer. This change simplifies the codebase, eliminating the need for introducing a new variable and a new check. Despite a slight overhead due to the pointer, this approach results in cleaner code while maintaining the passing status of the existing tests.
Related Tickets & Documents
Added/updated tests?
have not been included
Run verifications and test
make verify
is passingmake test
is passing