mirror of
				https://github.com/go-kratos/kratos.git
				synced 2025-10-30 23:47:59 +02:00 
			
		
		
		
	fix nil target (#774)
This commit is contained in:
		| @@ -24,7 +24,7 @@ func (codec) Marshal(v interface{}) ([]byte, error) { | ||||
| func (codec) Unmarshal(data []byte, v interface{}) error { | ||||
| 	rv := reflect.ValueOf(v) | ||||
| 	for rv.Kind() == reflect.Ptr { | ||||
| 		if rv.IsNil() && rv.CanSet() { | ||||
| 		if rv.IsNil() && rv.CanInterface() { | ||||
| 			rv.Set(reflect.New(rv.Type().Elem())) | ||||
| 			v = rv.Interface() | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user