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

refactor: remove unnecessary nil check in RunContext #1955

Merged
merged 1 commit into from
Aug 9, 2023
Merged

refactor: remove unnecessary nil check in RunContext #1955

merged 1 commit into from
Aug 9, 2023

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Aug 9, 2023

From the Go docs:

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

Therefore, an additional nil check for job.RunsOn() before the loop is unnecessary because job.RunsOn() returns a []string. Example: https://go.dev/play/p/cmcRrMJ6Mb4

From the Go docs:

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

Therefore, an additional nil check for `job.RunsOn()` before the loop is
unnecessary because `job.RunsOn()` returns a `[]string`.

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

Signed-off-by: Eng Zer Jun <[email protected]>
@Juneezee Juneezee requested a review from a team as a code owner August 9, 2023 02:14
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #1955 (5a2e6f6) into master (4989f44) will increase coverage by 0.90%.
Report is 220 commits behind head on master.
The diff coverage is 61.89%.

@@            Coverage Diff             @@
##           master    #1955      +/-   ##
==========================================
+ Coverage   61.22%   62.13%   +0.90%     
==========================================
  Files          46       52       +6     
  Lines        7141     8487    +1346     
==========================================
+ Hits         4372     5273     +901     
- Misses       2462     2795     +333     
- Partials      307      419     +112     
Files Changed Coverage Δ
pkg/common/outbound_ip.go 0.00% <0.00%> (ø)
pkg/container/docker_cli.go 82.23% <ø> (ø)
pkg/container/docker_logger.go 52.08% <ø> (ø)
pkg/container/docker_volume.go 0.00% <0.00%> (ø)
pkg/container/file_collector.go 39.68% <0.00%> (+2.38%) ⬆️
pkg/container/host_environment.go 0.00% <0.00%> (ø)
...ontainer/linux_container_environment_extensions.go 23.07% <0.00%> (-1.25%) ⬇️
pkg/container/util.go 0.00% <0.00%> (ø)
pkg/exprparser/functions.go 66.32% <0.00%> (-1.04%) ⬇️
pkg/container/docker_run.go 13.45% <7.14%> (-0.13%) ⬇️
... and 29 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mergify mergify bot merged commit 8a9e4f9 into nektos:master Aug 9, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants