MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / WriteConfigFile

Function WriteConfigFile

config/toml.go:59–67  ·  view source on GitHub ↗

WriteConfigFile renders config using the template and writes it to configFilePath.

(configFilePath string, config *Config)

Source from the content-addressed store, hash-verified

57
58// WriteConfigFile renders config using the template and writes it to configFilePath.
59func WriteConfigFile(configFilePath string, config *Config) {
60 var buffer bytes.Buffer
61
62 if err := configTemplate.Execute(&buffer, config); err != nil {
63 panic(err)
64 }
65
66 tmos.MustWriteFile(configFilePath, buffer.Bytes(), 0o644)
67}
68
69// Note: any changes to the comments/variables/mapstructure
70// must be reflected in the appropriate struct in config/config.go

Callers 2

SetupFunction · 0.92
writeDefaultConfigFileFunction · 0.85

Calls 2

ExecuteMethod · 0.65
BytesMethod · 0.65

Tested by

no test coverage detected