Skip to content

Commit

Permalink
使用原生转换
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Nov 20, 2024
1 parent 4d2fa26 commit 68839c7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions assignObj.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package mapper

import (
"fmt"
"reflect"
"strconv"
"strings"
"time"

"github.com/farseer-go/fs/dateTime"
"github.com/farseer-go/fs/fastReflect"
"github.com/farseer-go/fs/parse"
"github.com/farseer-go/fs/types"
"reflect"
"strings"
"time"
)

// 解析要赋值的对象
Expand Down Expand Up @@ -248,7 +250,7 @@ func (receiver *assignObj) assembleSlice(sourceMeta *valueMeta) {
for i := 0; i < sourceSliceCount; i++ {
// 转成切片的索引字段
field := reflect.StructField{
Name: parse.ToString(i),
Name: strconv.Itoa(i),
}
valMeta := newStructField(reflect.New(targetItemType).Elem(), field, &parent)
receiver.valueMeta = valMeta
Expand Down

0 comments on commit 68839c7

Please sign in to comment.