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

go-yaml v1.13.7 and go-yaml v1.13.8 parse error #528

Closed
yxxhero opened this issue Nov 13, 2024 · 5 comments · Fixed by #529
Closed

go-yaml v1.13.7 and go-yaml v1.13.8 parse error #528

yxxhero opened this issue Nov 13, 2024 · 5 comments · Fixed by #529
Labels
bug Something isn't working

Comments

@yxxhero
Copy link

yxxhero commented Nov 13, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

Please provide a minimum yaml content that can be reproduced.
We are more than happy to use Go Playground

package main

import (
	"fmt"

	"github.com/goccy/go-yaml"
)

func main() {
	yamlC := `helmfiles:
  - path: subhelmfile.yaml.gotmpl
    selectorsInherited: true
    values:
    - specificValues:
        
        myContainers:
        - command:
          - /bin/sh
          - -c
          - env
          image: registry.k8s.io/busybox
          name: test-container
        
`
	target := make(map[string]any)

	err := yaml.Unmarshal([]byte(yamlC), &target)
	if err != nil {
		fmt.Printf("%v", err)
	} else {
		fmt.Print("ok")
	}
}

Expected behavior
A clear and concise description of what you expected to happen.

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

Version Variables

  • Go version: 1.23
  • go-yaml's Version: 1.13.8

Additional context
Add any other context about the problem here.

@yxxhero yxxhero added the bug Something isn't working label Nov 13, 2024
@goccy
Copy link
Owner

goccy commented Nov 13, 2024

@yxxhero Thank you for your reports, but I couldn't reproduce from the provided example code.
Please provide a full yaml content that can be reproduced. Also, I'm more than happy to use Go Playground

@yxxhero
Copy link
Author

yxxhero commented Nov 13, 2024

@goccy thanks so much for your feedback. I use https://go.dev/play/p/cG_sFccgqTk to reproduce this issue. please review. thanks so much.

@yxxhero
Copy link
Author

yxxhero commented Nov 13, 2024

there are some extra space char in the end. but it's right yaml format.

@yxxhero
Copy link
Author

yxxhero commented Nov 13, 2024

@goccy thanks so much.

@goccy
Copy link
Owner

goccy commented Nov 13, 2024

Thank you for your additional information ! I've found this problem and fixed with #529 !

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

Successfully merging a pull request may close this issue.

2 participants