Giter Site home page Giter Site logo

Comments (4)

tiltwind avatar tiltwind commented on June 7, 2024

java 把 Object[] 序列化,为了TypedList, 但是 golang 把 interface{} 切片序列化为了 UntypedList 这个又是为什么呢?

@alpha-baby 你的意思是 java中 如果 Object[] 中只有一个元素,就会序列化为 TypedList, 如果有2个不同的元素就会序列化为 UntypedList 吗? 如果真是这样,就变得不可预期,是不是一种不可取的方式?

from dubbo-go-hessian2.

alpha-baby avatar alpha-baby commented on June 7, 2024

java 把 Object[] 序列化,为了TypedList, 但是 golang 把 interface{} 切片序列化为了 UntypedList 这个又是为什么呢?

@alpha-baby 你的意思是 java中 如果 Object[] 中只有一个元素,就会序列化为 TypedList, 如果有2个不同的元素就会序列化为 UntypedList 吗? 如果真是这样,就变得不可预期,是不是一种不可取的方式?

不管有几个元素都会序列化成 TypedList, 这里和元素个数没得关系,

from dubbo-go-hessian2.

tiltwind avatar tiltwind commented on June 7, 2024

@alpha-baby 跨语言访问最好还是不要使用特定语言中才有的类定义,如果要兼容,需要在go中特殊定义,参考 https://github.com/apache/dubbo-go-hessian2/blob/master/java_util/README_CN.md

from dubbo-go-hessian2.

alpha-baby avatar alpha-baby commented on June 7, 2024

https://github.com/apache/dubbo-go-hessian2/blob/master/java_util/README_CN.md

确实是这样,我这里的情况是,对方定义的那个 java 接口已经很多年了,方法入参中已经定义成了 List

from dubbo-go-hessian2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.