Skip to content

[BUG] 自定义解析传入的conent为nil #204

@fengqi

Description

@fengqi

请简单描述bug的场景
通过 extension.AddFormatParser(constant.DEFAULT, &Parser{}) 添加的自定义parse,发现传入的值为空

如何重现
按这个demo测试,Parse方法收到的数据为空

https://github.com/zouyx/agollo_demo/blob/master/custom/file/check.go#L76

type Parser struct {}

func (d *Parser) Parse(content interface{}) (map[string]interface{}, error) {
	fmt.Println(content)
	return nil, nil
}

看了下,https://github.com/apolloconfig/agollo/blob/master/component/remote/sync.go#L85 这里 configurations[defaultContentKey] 是没有值的,我使用的是 properties 格式,configurations只有配置信息,没有conent这个key,那 m, err := parser.Parse(configurations[defaultContentKey]) 传入的就是nil

期望
传入content原始内容

截图
1641294558534

Agollo 版本 :
1.9.0
我是使用的 https://github.com/apolloconfig/apollo-build-scripts 部署的测试环境。

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions