Skip to content

Conversation

@crenshaw-dev
Copy link
Member

I took the liberty of simplifying the dig function even more than required to fix the lint.

@crenshaw-dev crenshaw-dev requested a review from a team as a code owner June 13, 2025 20:34
@bunnyshell
Copy link

bunnyshell bot commented Jun 13, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Comment on lines +1419 to +1423
switch segment := segment.(type) {
case int:
i = i.([]any)[segment.(int)]
i = i.([]any)[segment]
case string:
i = i.(map[string]any)[segment.(string)]
i = i.(map[string]any)[segment]
Copy link
Member Author

Choose a reason for hiding this comment

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

These three lines are what the linter required.

}

func dig[T any](obj any, path []any) T {
func dig(obj any, path ...any) any {
Copy link
Member Author

Choose a reason for hiding this comment

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

Got rid of generics (not needed) and replaced slice w/ nicer alternative.

Signed-off-by: Michael Crenshaw <[email protected]>
@codecov
Copy link

codecov bot commented Jun 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.05%. Comparing base (10fa1aa) to head (00b88b4).
⚠️ Report is 420 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #23391      +/-   ##
==========================================
- Coverage   60.10%   60.05%   -0.06%     
==========================================
  Files         342      342              
  Lines       58820    58820              
==========================================
- Hits        35353    35323      -30     
- Misses      20623    20641      +18     
- Partials     2844     2856      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@crenshaw-dev crenshaw-dev enabled auto-merge (squash) June 16, 2025 14:19
@crenshaw-dev crenshaw-dev merged commit 114693d into argoproj:master Jun 16, 2025
27 checks passed
jcogilvie pushed a commit to Sanyaku/argo-cd that referenced this pull request Jun 16, 2025
Signed-off-by: Michael Crenshaw <[email protected]>
Signed-off-by: Jonathan Ogilvie <[email protected]>
enneitex pushed a commit to enneitex/argo-cd that referenced this pull request Aug 24, 2025
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