Fix go1.17 compatibility
This commit is contained in:
parent
8be1fd2348
commit
06b5e07b8a
@ -145,7 +145,7 @@ func (c *Client) Call(rcvr, method string, arg interface{}, ret interface{}) err
|
|||||||
}()
|
}()
|
||||||
} else {
|
} else {
|
||||||
// IF return value is not a pointer, return error
|
// IF return value is not a pointer, return error
|
||||||
if retVal.Kind() != reflect.Pointer {
|
if retVal.Kind() != reflect.Ptr {
|
||||||
return ErrReturnNotPointer
|
return ErrReturnNotPointer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ func Convert(in reflect.Value, toType reflect.Type) (reflect.Value, error) {
|
|||||||
to := reflect.New(toType).Elem()
|
to := reflect.New(toType).Elem()
|
||||||
|
|
||||||
// If type is a pointer
|
// If type is a pointer
|
||||||
if to.Kind() == reflect.Pointer {
|
if to.Kind() == reflect.Ptr {
|
||||||
// Initialize value
|
// Initialize value
|
||||||
to.Set(reflect.New(to.Type().Elem()))
|
to.Set(reflect.New(to.Type().Elem()))
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ func (s *Server) Register(v any) error {
|
|||||||
// create variable to store name of v
|
// create variable to store name of v
|
||||||
var name string
|
var name string
|
||||||
switch kind {
|
switch kind {
|
||||||
case reflect.Pointer:
|
case reflect.Ptr:
|
||||||
// If v is a pointer, get the name of the underlying type
|
// If v is a pointer, get the name of the underlying type
|
||||||
name = val.Elem().Type().Name()
|
name = val.Elem().Type().Name()
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
|
Reference in New Issue
Block a user