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(root_config): remove redundant nil check in Init #2412

Merged
merged 1 commit into from
Sep 4, 2023
Merged

refactor(root_config): remove redundant nil check in Init #2412

merged 1 commit into from
Sep 4, 2023

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Sep 1, 2023

From the Go specification:

"3. If the map is nil, 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/7FQ6fOesRuY

From the Go specification:

  "3. If the map is nil, 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>
@sonarcloud
Copy link

sonarcloud bot commented Sep 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@justxuewei justxuewei left a comment

Choose a reason for hiding this comment

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

Lgtm, thanks @Juneezee!

@codecov-commenter
Copy link

Codecov Report

Merging #2412 (ce305a9) into main (0a02805) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main    #2412      +/-   ##
==========================================
+ Coverage   44.43%   44.44%   +0.01%     
==========================================
  Files         303      303              
  Lines       18402    18409       +7     
==========================================
+ Hits         8177     8182       +5     
- Misses       9360     9362       +2     
  Partials      865      865              
Files Changed Coverage Δ
config/root_config.go 66.01% <33.33%> (-0.33%) ⬇️

... and 5 files with indirect coverage changes

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

Copy link
Contributor

@chickenlj chickenlj left a comment

Choose a reason for hiding this comment

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

LGTM.

@chickenlj chickenlj merged commit 6de48b3 into apache:main Sep 4, 2023
6 checks 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.

None yet

4 participants