bug fix
This commit is contained in:
		
							parent
							
								
									2185a61564
								
							
						
					
					
						commit
						198f3ebb5d
					
				
							
								
								
									
										15
									
								
								reflect.go
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								reflect.go
									
									
									
									
									
								
							@ -26,7 +26,9 @@ func (star *StarRows) setAllRefValue(stc interface{}, skey string, rows int) err
 | 
				
			|||||||
		tp := t.Field(i)
 | 
							tp := t.Field(i)
 | 
				
			||||||
		srFrd := v.Field(i)
 | 
							srFrd := v.Field(i)
 | 
				
			||||||
		seg := tp.Tag.Get(skey)
 | 
							seg := tp.Tag.Get(skey)
 | 
				
			||||||
 | 
							if seg == "" && !tp.IsExported() {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if srFrd.Kind() == reflect.Ptr && reflect.TypeOf(srFrd.Interface()).Elem().Kind() == reflect.Struct {
 | 
							if srFrd.Kind() == reflect.Ptr && reflect.TypeOf(srFrd.Interface()).Elem().Kind() == reflect.Struct {
 | 
				
			||||||
			if seg == "" {
 | 
								if seg == "" {
 | 
				
			||||||
				continue
 | 
									continue
 | 
				
			||||||
@ -49,9 +51,6 @@ func (star *StarRows) setAllRefValue(stc interface{}, skey string, rows int) err
 | 
				
			|||||||
				continue
 | 
									continue
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if seg == "" {
 | 
					 | 
				
			||||||
			continue
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if _, ok := star.Row(rows).columnref[seg]; !ok {
 | 
							if _, ok := star.Row(rows).columnref[seg]; !ok {
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@ -83,7 +82,7 @@ func (star *StarRows) setAllRefValue(stc interface{}, skey string, rows int) err
 | 
				
			|||||||
		case reflect.Float32:
 | 
							case reflect.Float32:
 | 
				
			||||||
			v.Field(i).SetFloat(float64(star.Row(rows).MustFloat32(seg)))
 | 
								v.Field(i).SetFloat(float64(star.Row(rows).MustFloat32(seg)))
 | 
				
			||||||
		case reflect.Slice, reflect.Array:
 | 
							case reflect.Slice, reflect.Array:
 | 
				
			||||||
			if v.Field(i).Elem().Kind() == reflect.Uint8 {
 | 
								if t.Field(i).Type.Elem().Kind() == reflect.Uint8 {
 | 
				
			||||||
				v.Field(i).SetBytes(star.Row(rows).MustBytes(seg))
 | 
									v.Field(i).SetBytes(star.Row(rows).MustBytes(seg))
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		case reflect.Interface, reflect.Struct, reflect.Ptr:
 | 
							case reflect.Interface, reflect.Struct, reflect.Ptr:
 | 
				
			||||||
@ -138,6 +137,9 @@ func getAllRefValue(stc interface{}, skey string) (map[string]interface{}, error
 | 
				
			|||||||
		tp := t.Field(i)
 | 
							tp := t.Field(i)
 | 
				
			||||||
		srFrd := v.Field(i)
 | 
							srFrd := v.Field(i)
 | 
				
			||||||
		seg := tp.Tag.Get(skey)
 | 
							seg := tp.Tag.Get(skey)
 | 
				
			||||||
 | 
							if seg == "" && !tp.IsExported() {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if srFrd.Kind() == reflect.Ptr && reflect.TypeOf(srFrd.Interface()).Elem().Kind() == reflect.Struct {
 | 
							if srFrd.Kind() == reflect.Ptr && reflect.TypeOf(srFrd.Interface()).Elem().Kind() == reflect.Struct {
 | 
				
			||||||
			if srFrd.IsNil() {
 | 
								if srFrd.IsNil() {
 | 
				
			||||||
				continue
 | 
									continue
 | 
				
			||||||
@ -196,6 +198,9 @@ func getAllRefKey(stc interface{}, skey string) ([]string, error) {
 | 
				
			|||||||
		srFrd := v.Field(i)
 | 
							srFrd := v.Field(i)
 | 
				
			||||||
		profile := t.Field(i)
 | 
							profile := t.Field(i)
 | 
				
			||||||
		seg := profile.Tag.Get(skey)
 | 
							seg := profile.Tag.Get(skey)
 | 
				
			||||||
 | 
							if seg == "" && !profile.IsExported() {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if srFrd.Kind() == reflect.Ptr && reflect.TypeOf(srFrd.Interface()).Elem().Kind() == reflect.Struct {
 | 
							if srFrd.Kind() == reflect.Ptr && reflect.TypeOf(srFrd.Interface()).Elem().Kind() == reflect.Struct {
 | 
				
			||||||
			if srFrd.IsNil() {
 | 
								if srFrd.IsNil() {
 | 
				
			||||||
				continue
 | 
									continue
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user