env icon indicating copy to clipboard operation
env copied to clipboard

slice的bug

Open soluty opened this issue 6 years ago • 1 comments

在没有填任何值的时候,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)

soluty avatar Mar 20 '19 03:03 soluty

got it, 你也可以提个commit

timest avatar Mar 22 '19 02:03 timest