我配置的是yml文件,为啥读取出来是个ppro?
我在我的阿波罗配置里面这个namespace配置的是yml
但是读取出来的是ppro的键值对。框架不应该改变我远程的文件属性吧?
看代码中是有转换逻辑的,可以 debug 看看
https://github.com/apolloconfig/agollo/blob/7b9b2c34de437144da34d9d0d7675b0cbde5d62f/component/remote/sync.go#L75-L88
看代码中是有转换逻辑的,可以 debug 看看
agollo/component/remote/sync.go
Lines 75 to 88 in 7b9b2c3
parser := extension.GetFormatParser(constant.ConfigFileFormat(path.Ext(apolloConfig.NamespaceName))) if parser == nil { parser = extension.GetFormatParser(constant.DEFAULT) }
if parser == nil { return apolloConfig, nil }
content, ok := configurations[defaultContentKey] if !ok { content = string(b) } m, err := parser.Parse(content)
我看了,这里是json。但是我在apollo里面写的是yml类型的。我期望就是和json一样string原样给我,不需要转成其他格式
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.