-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Given an nested sequence:
arr:
- arr2:
[ "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" ]Parse the yaml into an ast.File. Then print the output of ast.String().
arr:
- arr2:
e", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]The nested sequence has been left-trimmed and is no longer syntactically an array.
To Reproduce
package main
import (
"fmt"
"github.com/goccy/go-yaml/parser"
)
func main() {
yml := `
arr:
- arr2:
[ "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" ]
`
ast, err := parser.ParseBytes([]byte(yml), parser.ParseComments)
if err != nil {
fmt.Println(err)
}
got := ast.String()
fmt.Println(got)
}Expected behavior
Expected valid and semantically identical YML to be emitted.
Version Variables
- Go version: 1.24
- go-yaml's Version: 1.17.1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working