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

fix staticcheck warnings #191

Merged
merged 7 commits into from
Feb 15, 2024

Conversation

kartikaysaxena
Copy link
Contributor

Fixes #190

@kartikaysaxena kartikaysaxena changed the title fix dependencies fix staticcheck warnings Feb 4, 2024
Comment on lines -136 to -145
// Helper function to check the presence of a string in a slice
func sliceContains(s []string, e string) bool {
for _, a := range s {
if a == e {
return true
}
}
return false
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it because the lint was complaining about unused helper function

Comment on lines +138 to +139
source := rand.NewSource(time.Now().UnixNano())
randomGenerator := rand.New(source)
Copy link
Contributor Author

@kartikaysaxena kartikaysaxena Feb 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed because rand.Seed is deprecated as of now.

@@ -45,7 +45,7 @@ func GetInfraList(c types.Credentials, pid string, request models.ListInfraReque
return InfraData{}, err
}

bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyBytes, err := io.ReadAll(resp.Body)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ioutil is deprecated in favour of io and os

@kartikaysaxena
Copy link
Contributor Author

Screenshot 2024-02-05 at 3 14 42 AM Now all warnings seems to be resolved.

@SarthakJain26
Copy link
Collaborator

@deep-poharkar @Nageshbansal please review this PR

@Nageshbansal
Copy link
Collaborator

Lgtm 🚀

@deep-poharkar
Copy link
Contributor

looks good

@SarthakJain26
Copy link
Collaborator

@kartikaysaxena can you please try to resolve the merge conflicts, we can take this PR in litmusctl 1.3.0 release

@kartikaysaxena kartikaysaxena force-pushed the fix-dependencies branch 3 times, most recently from ea2b541 to 9610e29 Compare February 15, 2024 09:26
Signed-off-by: Kartikay <[email protected]>
Signed-off-by: Kartikay <[email protected]>
@kartikaysaxena
Copy link
Contributor Author

Hey @SarthakJain26, both my commits are signed off, and DCO is passing, but it is still showing that merging is blocked. Can you help with that?

@SarthakJain26
Copy link
Collaborator

It's because the build pipeline is failing, here are the logs:
Screenshot 2024-02-15 at 3 12 11 PM

Signed-off-by: Kartikay <[email protected]>
@SarthakJain26
Copy link
Collaborator

@kartikaysaxena looks like there's one merge conflict, can you try resolving that as well please

Signed-off-by: Kartikay <[email protected]>
Signed-off-by: Kartikay <[email protected]>
Signed-off-by: Kartikay <[email protected]>
@SarthakJain26 SarthakJain26 merged commit 8a139b0 into litmuschaos:master Feb 15, 2024
4 checks passed
@SarthakJain26
Copy link
Collaborator

Thanks @kartikaysaxena for fixing this 🚀

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.

Resolve staticcheck warnings
6 participants