@@ -33,13 +33,13 @@ func getDefaultFiller() *Filler {
3333
3434func newDefaultFiller () * Filler {
3535 funcs := make (map [reflect.Kind ]fillerFunc , 0 )
36- funcs [reflect .Bool ] = func (field * fieldData , tagValue string ) {
37- value , _ := strconv .ParseBool (tagValue )
36+ funcs [reflect .Bool ] = func (field * fieldData ) {
37+ value , _ := strconv .ParseBool (field . TagValue )
3838 field .Value .SetBool (value )
3939 }
4040
41- funcs [reflect .Int ] = func (field * fieldData , tagValue string ) {
42- value , _ := strconv .ParseInt (tagValue , 10 , 64 )
41+ funcs [reflect .Int ] = func (field * fieldData ) {
42+ value , _ := strconv .ParseInt (field . TagValue , 10 , 64 )
4343 field .Value .SetInt (value )
4444 }
4545
@@ -48,15 +48,15 @@ func newDefaultFiller() *Filler {
4848 funcs [reflect .Int32 ] = funcs [reflect .Int ]
4949 funcs [reflect .Int64 ] = funcs [reflect .Int ]
5050
51- funcs [reflect .Float32 ] = func (field * fieldData , tagValue string ) {
52- value , _ := strconv .ParseFloat (tagValue , 64 )
51+ funcs [reflect .Float32 ] = func (field * fieldData ) {
52+ value , _ := strconv .ParseFloat (field . TagValue , 64 )
5353 field .Value .SetFloat (value )
5454 }
5555
5656 funcs [reflect .Float64 ] = funcs [reflect .Float32 ]
5757
58- funcs [reflect .Uint ] = func (field * fieldData , tagValue string ) {
59- value , _ := strconv .ParseUint (tagValue , 10 , 64 )
58+ funcs [reflect .Uint ] = func (field * fieldData ) {
59+ value , _ := strconv .ParseUint (field . TagValue , 10 , 64 )
6060 field .Value .SetUint (value )
6161 }
6262
@@ -65,22 +65,22 @@ func newDefaultFiller() *Filler {
6565 funcs [reflect .Uint32 ] = funcs [reflect .Uint ]
6666 funcs [reflect .Uint64 ] = funcs [reflect .Uint ]
6767
68- funcs [reflect .String ] = func (field * fieldData , tagValue string ) {
69- field .Value .SetString (tagValue )
68+ funcs [reflect .String ] = func (field * fieldData ) {
69+ field .Value .SetString (field . TagValue )
7070 }
7171
72- funcs [reflect .Slice ] = func (field * fieldData , tagValue string ) {
72+ funcs [reflect .Slice ] = func (field * fieldData ) {
7373 if field .Value .Type ().Elem ().Kind () == reflect .Uint8 {
7474 if field .Value .Bytes () != nil {
7575 return
7676 }
7777
78- field .Value .SetBytes ([]byte (tagValue ))
78+ field .Value .SetBytes ([]byte (field . TagValue ))
7979 }
8080 }
8181
82- funcs [reflect .Struct ] = func (field * fieldData , tagValue string ) {
83- fields := getDefaultFiller ().getFieldsFromValue (field .Value )
82+ funcs [reflect .Struct ] = func (field * fieldData ) {
83+ fields := getDefaultFiller ().getFieldsFromValue (field .Value , nil )
8484 getDefaultFiller ().setDefaultValues (fields )
8585 }
8686
0 commit comments