LaurenceLiZhixin commented on pull request #309:
URL: 
https://github.com/apache/dubbo-go-hessian2/pull/309#issuecomment-1015030754


   @wongoo 
   I have a question, can we encode a map without any registry? I think the 
map[string]interface{} contains all information  about a pojo.
   On the view of gateway filter, gateway can't get the real POJO of the 
object. But in the current implementation, this step is necessary.
   ```go
   // register pojo again, so that there are class definitions, which are used 
to encode map to object.
   /**
   Can these be omited.
   **/
   RegisterPOJO(name)
   RegisterPOJO(person)
   RegisterPOJO(worker1)
   RegisterPOJO(&worker1.Jobs[0])
   
   // encode the map to object again, note the worker2 is a map.
   e = NewEncoder()
   err = e.Encode(worker2)
   if err != nil {
   t.Error(err)
   t.FailNow()
   }
   
   ```


-- 
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