Skip to content

Support root level map keys in map sources#2047

Merged
dearchap merged 1 commit into
urfave:mainfrom
lukasbindreiter:main
Feb 8, 2025
Merged

Support root level map keys in map sources#2047
dearchap merged 1 commit into
urfave:mainfrom
lukasbindreiter:main

Conversation

@lukasbindreiter

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • bug

What this PR does / why we need it:

It fixes a bug in MapValueSource where lookup doesn't work for keys directly in the first level (root) of the map.

Which issue(s) this PR fixes:

Fixes #2037

Special notes for your reviewer:

The issue is related to this one I raised in cli-altsrc: urfave/cli-altsrc#14
I'll create a similar PR there as well.

Testing

I added a test case for this exact issue as well. It will fail without changes from the PR.
I also added another test case for the map[string]any special case that was in place in the code, to make sure that works to.

@lukasbindreiter

Copy link
Copy Markdown
Contributor Author

Related PR in cli-altsrc: urfave/cli-altsrc#16

@Juneezee Juneezee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks! 😊

@dearchap dearchap merged commit 8e49873 into urfave:main Feb 8, 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.

Support root level map keys in map sources

3 participants