mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Generic ast (#1829)
Remove dependency on yaml.Node for internal AST representation. Yaml decoder is now just another decoder.
This commit is contained in:
@@ -4,25 +4,13 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/diff"
|
||||
"github.com/pkg/diff/write"
|
||||
yaml "gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
func ParseData(rawData string) yaml.Node {
|
||||
var parsedData yaml.Node
|
||||
err := yaml.Unmarshal([]byte(rawData), &parsedData)
|
||||
if err != nil {
|
||||
fmt.Printf("Error parsing yaml: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
return parsedData
|
||||
}
|
||||
|
||||
func printDifference(t *testing.T, expectedValue interface{}, actualValue interface{}) {
|
||||
opts := []write.Option{write.TerminalColor()}
|
||||
var differenceBuffer bytes.Buffer
|
||||
|
||||
Reference in New Issue
Block a user