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

slice的bug #2

Open
soluty opened this issue Mar 20, 2019 · 1 comment
Open

slice的bug #2

soluty opened this issue Mar 20, 2019 · 1 comment

Comments

@soluty
Copy link

soluty commented Mar 20, 2019

在没有填任何值的时候,slice的字段应该返回nil或者长度为0的slice,现在的实现,会返回一个[ "" ],非常不自然,且不利于编写业务逻辑
具体代码在170行:
case reflect.Slice:
sep := ";"
s, exist := sf.Tag.Lookup("slice_sep")
if exist && s != "" {
sep = s
}
//我新加的
if ev == ""{
return nil
}
//我新加的 end
vals := strings.Split(ev, sep)

@timest
Copy link
Owner

timest commented Mar 22, 2019

got it, 你也可以提个commit

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

No branches or pull requests

2 participants