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

Remove redundant nil check in LocalFlagNames #1815

Merged
merged 1 commit into from
Oct 11, 2023
Merged

Remove redundant nil check in LocalFlagNames #1815

merged 1 commit into from
Oct 11, 2023

Conversation

Juneezee
Copy link
Member

What type of PR is this?

  • cleanup

What this PR does / why we need it:

From the Go specification:

"1. For a nil slice, the number of iterations is 0." https://go.dev/ref/spec#For_range

Therefore, an additional nil check for before the loop is unnecessary. Example: https://go.dev/play/p/_cXfzMOvMm3

Testing

go test ./...
?   	github.com/urfave/cli/v3/internal/build	[no test files]
?   	github.com/urfave/cli/v3/internal/example-cli	[no test files]
?   	github.com/urfave/cli/v3/internal/example-hello-world	[no test files]
ok  	github.com/urfave/cli/v3	0.101s

Release Notes

NONE

From the Go specification:

  "1. For a nil slice, the number of iterations is 0." [1]

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@Juneezee Juneezee requested a review from a team as a code owner September 16, 2023 04:12
@github-actions
Copy link


Frogbot also supports Contextual Analysis, Secret Detection and IaC Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system.


@dearchap dearchap merged commit e8abd76 into urfave:main Oct 11, 2023
1 check passed
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.

3 participants