MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / readConfigPart

Function readConfigPart

pkg/wconfig/settingsconfig.go:661–670  ·  view source on GitHub ↗

Combine files from the defaults and home directory for the specified config part name

(partName string, simpleMerge bool)

Source from the content-addressed store, hash-verified

659
660// Combine files from the defaults and home directory for the specified config part name
661func readConfigPart(partName string, simpleMerge bool) (waveobj.MetaMapType, []ConfigError) {
662 configDirAbsPath := wavebase.GetWaveConfigDir()
663 configDirFsys := os.DirFS(configDirAbsPath)
664 defaultConfigs, cerrs := readConfigPartForFS(defaultconfig.ConfigFS, "defaults:", partName, simpleMerge)
665 homeConfigs, cerrs1 := readConfigPartForFS(configDirFsys, "", partName, simpleMerge)
666
667 rtn := defaultConfigs
668 allErrs := append(cerrs, cerrs1...)
669 return mergeMetaMap(rtn, homeConfigs, simpleMerge), allErrs
670}
671
672// this function should only be called by the wconfig code.
673// in golang code, the best way to get the current config is via the watcher -- wconfig.GetWatcher().GetFullConfig()

Callers 1

ReadFullConfigFunction · 0.85

Calls 3

GetWaveConfigDirFunction · 0.92
readConfigPartForFSFunction · 0.85
mergeMetaMapFunction · 0.85

Tested by

no test coverage detected