You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/26 08:27:23 UTC
[GitHub] [dubbo-go] alchemy-lee opened a new issue #1412: Generic invocation failed when the response type is a slice
alchemy-lee opened a new issue #1412:
URL: https://github.com/apache/dubbo-go/issues/1412
**What happened**:
In dubbo-go v1.5.7, the generic invocation will fail when the response type is a slice. For example,
```go
func (u *UserProvider) GetUser(ctx context.Context, userID string) ([]*User, error) {
gxlog.CInfo("req:%#v", userID)
rsp := User{"A001", "Alex Stocks", 18, time.Now()}
gxlog.CInfo("rsp:%#v", rsp)
return []*User{&rsp, &rsp}, nil
}
```
The error log is:
```
2021-08-17T17:08:37.216+0800 ERROR dubbo/dubbo_codec.go:245 pkg.Unmarshal(len(@data):0) = error:can not find go type name com.dubbogo.pixiu.User in registry
github.com/apache/dubbo-go-hessian2.(*Decoder).getStructDefByIndex
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/object.go:576
github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/object.go:678
github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/decode.go:285
github.com/apache/dubbo-go-hessian2.(*Decoder).decObject
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/object.go:652
github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/decode.go:285
github.com/apache/dubbo-go-hessian2.(*Decoder).readUntypedList
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/list.go:414
github.com/apache/dubbo-go-hessian2.(*Decoder).decList
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/list.go:284
github.com/apache/dubbo-go-hessian2.(*Decoder).DecodeValue
D:/WorkSpace/GoLandProjects/dubbo-go-pixiu/vendor/github.com/apache/dubbo-go-hessian2/decode.go:278
github.com/apache/dubbo-go-hessian2.(*Decoder).Decode
```
**What you expected to happen**:
The generic invocation executes correctly.
**How to reproduce it (as minimally and precisely as possible)**:
Run the generic invocation I described.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo-go] alchemy-lee closed issue #1412: Generic invocation failed when the response type is a slice
Posted by GitBox <gi...@apache.org>.
alchemy-lee closed issue #1412:
URL: https://github.com/apache/dubbo-go/issues/1412
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org