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

Global variable isBig used for conditional switch Endianness #1

Open
diamondo25 opened this issue Sep 12, 2019 · 0 comments
Open

Global variable isBig used for conditional switch Endianness #1

diamondo25 opened this issue Sep 12, 2019 · 0 comments

Comments

@diamondo25
Copy link

I recommend setting a global variable pointing to the endianness (encoding.BigEndian, encoding.LittleEndian) over conditional switching between either variant using a global variable, to make the code simpler.

Best practice would be to not use globals at all. This helps with using golangs test framework in parallel and makes your code much cleaner. In addition to that, to figure out possible performance bottlenecks, you can use Benchmark* functions in your *_test.go files.

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

No branches or pull requests

1 participant