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

subscription: use const Method + some refactoring #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tzzed
Copy link
Contributor

@tzzed tzzed commented May 4, 2022

use const MethodPost + some refactoring.

r.Body = http.MaxBytesReader(w, r.Body, 8*1024*1024)

decoder := json.NewDecoder(r.Body)
r.Body = http.MaxBytesReader(w, r.Body, 8<<20)
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of using the bitwise operation instead of the numeric multiplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I my opinion it is better to use bit shifting for multiplication of power of two, even if finally is the same result but I think we should use a const for readability. What do you think about it?

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