知了go微服务实战
处理header函数
//处理header,防止修改头变量出现其他影响func CopyHeader(header *Header) *Header {
copyhead := *header if len(copyhead.Extradata) > 0 {
copyhead.Extradata = make([]byte, len(header.Extradata))
copy(copyhead.Extradata, header.Extradata)
}
return ©head}