add string support

This commit is contained in:
leafsoar 2017-09-20 17:01:21 +08:00
parent c9690500fa
commit 5959e6edd8
1 changed files with 4 additions and 0 deletions

View File

@ -425,6 +425,10 @@ func (session *Session) slice2Bean(scanResults []interface{}, fields []string, f
hasAssigned = true
if len(bs) > 0 {
if fieldType.Kind() == reflect.String {
fieldValue.SetString(string(bs))
continue
}
if fieldValue.CanAddr() {
err := json.Unmarshal(bs, fieldValue.Addr().Interface())
if err != nil {