Added github action fix for parsing xml, updated linter

This commit is contained in:
Mike Farah
2022-02-07 11:55:55 +11:00
parent 06e944dcb6
commit 26356ff4be
48 changed files with 238 additions and 339 deletions
-19
View File
@@ -6,32 +6,13 @@ import (
"fmt"
"os"
"reflect"
"strings"
"testing"
"github.com/pkg/diff"
"github.com/pkg/diff/write"
"github.com/spf13/cobra"
yaml "gopkg.in/yaml.v3"
)
type resulter struct {
Error error
Output string
Command *cobra.Command
}
func RunCmd(c *cobra.Command, input string) resulter {
buf := new(bytes.Buffer)
c.SetOutput(buf)
c.SetArgs(strings.Split(input, " "))
err := c.Execute()
output := buf.String()
return resulter{err, output, c}
}
func ParseData(rawData string) yaml.Node {
var parsedData yaml.Node
err := yaml.Unmarshal([]byte(rawData), &parsedData)