before merging in essential fixes.

This commit is contained in:
2025-01-07 09:27:12 +01:00
parent 14173945c8
commit e73d3ac165
6 changed files with 170 additions and 72 deletions
+30
View File
@@ -0,0 +1,30 @@
package main
import (
"github.com/goccy/go-yaml"
"github.com/spf13/cobra"
"os"
)
func mergeMap(yaml1 yaml.MapSlice, yaml2 yaml.MapSlice) yaml.MapSlice {
res := yaml1
//for key, item := range yaml2 {
// switch {
// case res.ToMap()[key] != nil && type
//
// }
//}
return res
}
func merge(cmd *cobra.Command, args []string) error {
res := make(yaml.MapSlice, 0)
for _, arg := range args {
config := parse(read(arg))
res = mergeMap(res, config)
}
encode(os.Stdout, res)
return nil
}