MCPcopy
hub / github.com/wavetermdev/waveterm / parseMetaSets

Function parseMetaSets

cmd/wsh/cmd/wshcmd-setmeta.go:128–146  ·  view source on GitHub ↗
(metaSets []string)

Source from the content-addressed store, hash-verified

126}
127
128func parseMetaSets(metaSets []string) (map[string]any, error) {
129 meta := make(map[string]any)
130 for _, metaSet := range metaSets {
131 fields := strings.SplitN(metaSet, "=", 2)
132 if len(fields) != 2 {
133 return nil, fmt.Errorf("invalid meta set: %q", metaSet)
134 }
135
136 val, err := parseMetaValue(fields[1])
137 if err != nil {
138 return nil, err
139 }
140
141 // Split the key path and set nested value
142 path := strings.Split(fields[0], "/")
143 setNestedValue(meta, path, val)
144 }
145 return meta, nil
146}
147
148func simpleMergeMeta(meta map[string]interface{}, metaUpdate map[string]interface{}) map[string]interface{} {
149 for k, v := range metaUpdate {

Callers 4

setConfigRunFunction · 0.85
TestParseMetaSetsFunction · 0.85
setMetaRunFunction · 0.85
createBlockRunFunction · 0.85

Calls 2

parseMetaValueFunction · 0.85
setNestedValueFunction · 0.85

Tested by 1

TestParseMetaSetsFunction · 0.68