add string support (#730)

This commit is contained in:
无间落叶 2017-10-24 04:51:27 -05:00 committed by Lunny Xiao
parent 165dd989d0
commit fdbf36d7ea
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
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 {