Merge branch 'master' into lunny/test_json_string

This commit is contained in:
Lunny Xiao 2017-10-24 17:51:35 +08:00 committed by GitHub
commit fe03aaa7ad
1 changed files with 4 additions and 0 deletions

View File

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