marsevilspirit commented on PR #2928: URL: https://github.com/apache/dubbo-go/pull/2928#issuecomment-3051056084
> 因为我看过这段代码 ‘’‘ for key, valRaw := range dubbo3Resp.Attachments() { switch valRaw.(type) { case string: trailer[key] = []string{valRaw.(string)} case []string: trailer[key] = valRaw.([]string) default: panic(fmt.Sprintf("unsupported attachment value type %T", valRaw)) } } ’‘’ 直接panic了,所以我也没做处理。其实统一,到底能不能传非string或者[]string的值。而且到接收端,从其他结构变成string,感觉也不适合,真正的完美应该可以支持所有类型,接收端能够反序列化 如果想要支持所有类型的话,建议放在reqs, resp结构体中,triple的attachments是放在http协议的header中,将header字段序列化反序列化太奇怪了 -- 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-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org