LaurenceLiZhixin commented on a change in pull request #214:
URL: https://github.com/apache/dubbo-go-samples/pull/214#discussion_r699762361



##########
File path: rpc/jsonrpc/go-client/pkg/user.go
##########
@@ -34,18 +34,18 @@ type JsonRPCUser struct {
 func (u JsonRPCUser) String() string {
        return fmt.Sprintf(
                "User{ID:%s, Name:%s, Age:%d, Time:%s, Sex:%s}",
-               u.ID, u.Name, u.Age, time.Unix(u.Time, 0).Format("2006-01-02 
15:04:05.99999"), u.Sex,
+               u.ID, u.Name, u.Age, time.Unix(int64(u.Time), 
0).Format("2006-01-02 15:04:05.99999"), u.Sex,
        )
 }
 
 type UserProvider struct {
        GetUsers func(req []interface{}) ([]JsonRPCUser, error)
-       GetUser  func(ctx context.Context, req []interface{}, rsp *JsonRPCUser) 
error
+       GetUser  func(ctx context.Context, req []interface{}) (JsonRPCUser, 
error)
        GetUser0 func(id string, name string) (JsonRPCUser, error)
-       GetUser1 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser) 
error
-       GetUser2 func(ctx context.Context, req []interface{}, rsp *JsonRPCUser) 
error `dubbo:"getUser"`
+       GetUser1 func(ctx context.Context, req []interface{}) (JsonRPCUser, 
error)
+       GetUser2 func(ctx context.Context, req []interface{}) (JsonRPCUser, 
error) `dubbo:"getUser"`

Review comment:
       把[]interface{}参数都改成具体的类型

##########
File path: rpc/jsonrpc/go-server/pkg/user_provider.go
##########
@@ -29,7 +45,7 @@ func (u *UserProvider) getUser(userID string) (*User, error) {
        return nil, fmt.Errorf("invalid user id:%s", userID)
 }
 
-func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp 
*User) error {
+func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, 
error) {

Review comment:
       使用旧版本的例子可以直接删掉了




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to