MCPcopy Create free account
hub / github.com/MertJSX/folderhost / getVersion

Function getVersion

utils/migrate_config.go:79–94  ·  view source on GitHub ↗
(root *yaml.Node)

Source from the content-addressed store, hash-verified

77}
78
79func getVersion(root *yaml.Node) string {
80 if root.Kind != yaml.DocumentNode || len(root.Content) == 0 {
81 return ""
82 }
83 mapping := root.Content[0]
84 if mapping.Kind != yaml.MappingNode {
85 return ""
86 }
87
88 for i := 0; i < len(mapping.Content); i += 2 {
89 if mapping.Content[i].Value == "version" {
90 return mapping.Content[i+1].Value
91 }
92 }
93 return ""
94}
95
96func mergeYamlNodes(dst, src *yaml.Node) {
97 if dst.Kind != yaml.MappingNode || src.Kind != yaml.MappingNode {

Callers 1

MigrateConfigIfNeededFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected