apache/dubbo-go-hessian2

bigdecimal与golang中类型对应关系问题?

wongoo opened this issue · 2 comments

What happened:
linked to: apache/dubbo-go#109

What you expected to happen:
encode/decode support for java Bigdecimal

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

the key point is to find out what the encode result of java BigDecimal.

  • if it's encoded as a hessian object, then define a POJO in go to decode
  • if it's encoded as a hessian double, then using float64 in go to decode
type BigDecimal struct {
     ...
}

func (BigDecimal) JavaClassName() string {
	return "java.math.BigDecimal"
}

how to declare in the struct body?