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

bug on inline array reading #128

Closed
nicolasboulay opened this issue Jun 10, 2020 · 1 comment · Fixed by #138
Closed

bug on inline array reading #128

nicolasboulay opened this issue Jun 10, 2020 · 1 comment · Fixed by #138
Labels
bug Something isn't working

Comments

@nicolasboulay
Copy link

nicolasboulay commented Jun 10, 2020

https://play.golang.org/p/l3cZy3n9T62

package main

import (
	"fmt"
	"github.com/goccy/go-yaml"
	y "gopkg.in/yaml.v2"
)

func main() {
	yml := `
- a: [2 , 2] 			
  b: [2 , 2] 			
  c: [2 , 2]`
	var d interface{}
	yaml.Unmarshal([]byte(yml), &d)
	fmt.Printf("%v\n%v\n", yml, d)
	y.Unmarshal([]byte(yml), &d)
	fmt.Printf("%v\n%v\n", yml, d)
}
- a: [2 , 2] 			
  b: [2 , 2] 			
  c: [2 , 2]
[map[a:[2 2]]]

- a: [2 , 2] 			
  b: [2 , 2] 			
  c: [2 , 2]
[map[a:[2 2] b:[2 2] c:[2 2]]]
@goccy
Copy link
Owner

goccy commented Jun 11, 2020

I found this bug was due to inserting a tab character after the ] character.
I'm going to fix this soon .

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