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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ineffassign static code analyzer #8755

Open
farazdagi opened this issue Apr 13, 2021 · 2 comments
Open

Improve ineffassign static code analyzer #8755

farazdagi opened this issue Apr 13, 2021 · 2 comments
Labels
CI Continuous integration related items Cleanup Code health! Good First Issue Good for newcomers Priority: Low Low priority item

Comments

@farazdagi
Copy link
Contributor

馃殌 Feature Request

Description

@nisdas has found an interesting use case where our ineffassign analyzer can be improved, this issue is to track the possible resolution for such a case.

Describe the solution you'd like

Consider the following snippet:

unusedSlice := make([][]byte,100) 

for i,_ := range unusedSlice {
  unusedSlice[i] = []byte{'j','u','n','k'}
} 

and then unusedSlice is never used.

Our ineffassign should be able to catch cases like this.

@farazdagi farazdagi added CI Continuous integration related items Cleanup Code health! labels Apr 13, 2021
@0xKiwi 0xKiwi added the Priority: Low Low priority item label May 28, 2021
@prestonvanloon prestonvanloon added the Good First Issue Good for newcomers label Jun 4, 2021
@eshaan7
Copy link

eshaan7 commented Jul 28, 2021

Hi. This is my first interaction on this repository.

From what I can gather, this improvement needs to be made in the ineffassign repository, right ?

@prestonvanloon
Copy link
Member

@eshaan7 This refers to our static analysis tooling https://github.com/prysmaticlabs/prysm/tree/develop/tools/analyzers/ineffassign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration related items Cleanup Code health! Good First Issue Good for newcomers Priority: Low Low priority item
Projects
None yet
Development

No branches or pull requests

4 participants