Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Convert to string type when returning [] byte type #596

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

snowsi
Copy link
Contributor

@snowsi snowsi commented Jul 19, 2023

场景:
当 transformer interceptor 的 equal(key, target) 条件,key 设置为 body 时,eventops.Get 函数返回的 interface{} 的底层类型是 []byte,与 eq.value 的 string 类型不匹配,导致 == 判断失败。

处理方法:
当获取到 eventops.Get 返回值时进行类型断言判断是否是 []byte 类型,如果是则进行类型转换,再进行比较。

@ethfoo ethfoo merged commit 1a7b7dc into loggie-io:main Jul 21, 2023
2 checks passed
ethfoo pushed a commit that referenced this pull request Aug 3, 2023
Co-authored-by: jishengjie <jishengjie@kylinos.cn>
ethfoo pushed a commit that referenced this pull request Aug 3, 2023
Co-authored-by: jishengjie <jishengjie@kylinos.cn>
Max-Cheng pushed a commit to Max-Cheng/loggie that referenced this pull request Aug 8, 2023
Co-authored-by: jishengjie <jishengjie@kylinos.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants