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

path.Replace changing type creates a weird yaml result #607

Open
gkampitakis opened this issue Dec 23, 2024 · 1 comment
Open

path.Replace changing type creates a weird yaml result #607

gkampitakis opened this issue Dec 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gkampitakis
Copy link

Describe the bug

Hi, again thanks for maintaining this great library 🙇 . I was trying to dynamically replace a path that was integer to a map and the result of the path.ReplaceWithReader looks weird and wrong. Maybe what I am trying to do is wrong or not supported, so sorry for the noise if that's the case.

To Reproduce

I think the go playground is easier to describe the issue I am noticing 😅 https://go.dev/play/p/SvDu9jqRw8a.

Expected behavior

Not sure if this is supposed to be supported, changing the type. I would either expect to fail or work and creating an object like
instead of doing this weird invalid merging and cutting the workds.

age:
  in_months: 120
  in_years: 10

Screenshots
If applicable, add screenshots to help explain your problem.

Version Variables

  • Go version: [e.g. 1.21 ]
  • go-yaml's Version: [e.g. v1.11.1 ]

Additional context
Add any other context about the problem here.

@gkampitakis gkampitakis added the bug Something isn't working label Dec 23, 2024
@gkampitakis
Copy link
Author

gkampitakis commented Dec 23, 2024

I have also tried with

struct {
	InYears  uint64 `yaml:"in_years"`
	InMonths uint64 `yaml:"in_months"`
}{
	InYears:  10,
	InMonths: 120,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant