Skip to content

Global variable isBig used for conditional switch Endianness #1

@diamondo25

Description

@diamondo25

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions