Skip to content

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