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

drivers/gpio: SA4000 warning in max7219_driver.go #617

Closed
quasilyte opened this issue Sep 14, 2018 · 3 comments
Closed

drivers/gpio: SA4000 warning in max7219_driver.go #617

quasilyte opened this issue Sep 14, 2018 · 3 comments

Comments

@quasilyte
Copy link

Both gocritic and megacheck (staticcheck) find these code lines suspicious:

a.All(MAX7219Intensity, level&level)

a.All(MAX7219Intensity, 0x0f&0x0f)

& is used with same RHS and LHS operands.

Should probably be simplified as x&x=>x, but as it looks somewhat confusing, I've opened an issue instead of sending a PR (maybe there is some IoT-related domain convention so x&x makes sense here).

@deadprogram
Copy link
Member

Hello @quasilyte I agree that looks very odd to me. @conejoninja any reason not to simplify this code?

conejoninja added a commit to conejoninja/gobot that referenced this issue Sep 16, 2018
deadprogram added a commit that referenced this issue Sep 16, 2018
@deadprogram deadprogram added interface-request things like new protocols and/or interfaces and removed question labels Sep 16, 2018
@deadprogram
Copy link
Member

There is now code in the dev branch thanks to @conejoninja so I will leave this open until the next release. Thanks everyone!

deadprogram pushed a commit that referenced this issue May 22, 2019
@deadprogram deadprogram removed the interface-request things like new protocols and/or interfaces label May 22, 2019
@deadprogram
Copy link
Member

This code was release in v1.13.0 thank you! Now closing.

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

2 participants