MCPcopy Index your code
hub / github.com/apache/answer / RewriteConfig

Function RewriteConfig

internal/base/conf/conf.go:117–128  ·  view source on GitHub ↗

RewriteConfig rewrite config file path

(configFilePath string, allConfig *AllConfig)

Source from the content-addressed store, hash-verified

115
116// RewriteConfig rewrite config file path
117func RewriteConfig(configFilePath string, allConfig *AllConfig) error {
118 buf := bytes.Buffer{}
119 enc := yaml.NewEncoder(&buf)
120 defer func() {
121 _ = enc.Close()
122 }()
123 enc.SetIndent(2)
124 if err := enc.Encode(allConfig); err != nil {
125 return err
126 }
127 return writer.ReplaceFile(configFilePath, buf.String())
128}

Callers 1

InitEnvironmentFunction · 0.92

Calls 2

ReplaceFileFunction · 0.92
CloseMethod · 0.65

Tested by

no test coverage detected