Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix map unflattening no-delimiter behaviour#278

Merged
knadh merged 2 commits intomasterfrom
fix-unflatten
Apr 3, 2024
Merged

Fix map unflattening no-delimiter behaviour#278
knadh merged 2 commits intomasterfrom
fix-unflatten

Conversation

@knadh
Copy link
Owner

@knadh knadh commented Mar 9, 2024

@rhnvrm please take a look at the commit that fixes the undefined variable delim. I'm wondering how all the tests were passing despite maps_test.go having a compile error.

Closes #275

@rhnvrm rhnvrm changed the title Fix map unflattening no-delimiter behaviour. Closes #275. Fix map unflattening no-delimiter behaviour Mar 10, 2024
rhnvrm
rhnvrm previously requested changes Mar 10, 2024
Copy link
Collaborator

@rhnvrm rhnvrm left a comment

Choose a reason for hiding this comment

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

When tests run, they run for the whole package. Since delim is defined in koanf_test.go file, we need to run both files while testing.

image

We should not remove the delim constant from maps_test.go in my opinion and use the same constant delim.

Maybe we can add a new test with empty delim for checking the edited logic.

@knadh knadh dismissed rhnvrm’s stale review April 3, 2024 07:13

This is fixed.

@knadh knadh merged commit 5c37bab into master Apr 3, 2024
codeboten referenced this pull request in open-telemetry/opentelemetry-collector Apr 9, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/knadh/koanf/v2](https://togithub.com/knadh/koanf) |
`v2.1.0` -> `v2.1.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fknadh%2fkoanf%2fv2/v2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fknadh%2fkoanf%2fv2/v2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fknadh%2fkoanf%2fv2/v2.1.0/v2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fknadh%2fkoanf%2fv2/v2.1.0/v2.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>knadh/koanf (github.com/knadh/koanf/v2)</summary>

### [`v2.1.1`](https://togithub.com/knadh/koanf/releases/tag/v2.1.1)

[Compare
Source](https://togithub.com/knadh/koanf/compare/v2.1.0...v2.1.1)

#### What's Changed

- fix: run submodule tests by
[@&#8203;rhnvrm](https://togithub.com/rhnvrm) in
[https://github.com/knadh/koanf/pull/276](https://togithub.com/knadh/koanf/pull/276)
- Bump google.golang.org/protobuf from 1.30.0 to 1.33.0 in /examples by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/knadh/koanf/pull/282](https://togithub.com/knadh/koanf/pull/282)
- Bump google.golang.org/protobuf from 1.30.0 to 1.33.0 in
/providers/etcd by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[https://github.com/knadh/koanf/pull/281](https://togithub.com/knadh/koanf/pull/281)
- Bump google.golang.org/protobuf from 1.30.0 to 1.33.0 in
/providers/nats by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[https://github.com/knadh/koanf/pull/280](https://togithub.com/knadh/koanf/pull/280)
- feat: add ParserEnvWithValue by
[@&#8203;tlipoca9](https://togithub.com/tlipoca9) in
[https://github.com/knadh/koanf/pull/284](https://togithub.com/knadh/koanf/pull/284)
- Fix map unflattening no-delimiter behaviour by
[@&#8203;knadh](https://togithub.com/knadh) in
[https://github.com/knadh/koanf/pull/278](https://togithub.com/knadh/koanf/pull/278)

#### New Contributors

- [@&#8203;tlipoca9](https://togithub.com/tlipoca9) made their first
contribution in
[https://github.com/knadh/koanf/pull/284](https://togithub.com/knadh/koanf/pull/284)

**Full Changelog**:
knadh/koanf@v2.1.0...v2.1.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
@knadh knadh deleted the fix-unflatten branch August 16, 2024 05:12
@nicohertz
Copy link

@knadh is there a release with this fix? I seem to experiencing this bug

I am importing

github.com/knadh/koanf/parsers/yaml v0.1.0
github.com/knadh/koanf/providers/confmap v0.1.0
github.com/knadh/koanf/providers/env v1.0.0
github.com/knadh/koanf/providers/file v1.1.2
github.com/knadh/koanf/v2 v2.1.2

which are indirectly bringing github.com/knadh/koanf/maps v0.1.1

As per https://pkg.go.dev/github.com/knadh/koanf/maps the last release is from 2023.

Thanks so much for the help.

knadh added a commit that referenced this pull request Apr 1, 2025
@knadh
Copy link
Owner Author

knadh commented Apr 1, 2025

@nhertzulis I'd missed tagging the fix. Just pushed maps/v0.1.2 and updated koanf master to reference this. You can update koanf to the tip with go get -u github.com/knadh/koanf@master. There are a few other minor pending things that have to be resolved before I can tag the tip.

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.

koanf.Unmarshal doesn't work when loaded with env provider

3 participants