Skip to content

Commit

Permalink
消息id生成不再耦合包名
Browse files Browse the repository at this point in the history
  • Loading branch information
davyxu committed Aug 11, 2021
1 parent db7fce9 commit bfe2397
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codegen/msgid.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func StructMsgID(d *model.Descriptor) (msgid int) {
}

if msgid == 0 {
msgid = int(stringHash(strings.ToLower(d.DescriptorSet.PackageName + d.Name)))
// 这里不能引入packageName, 不同语言的package设置为不同, 造成消息id不一致
msgid = int(stringHash(strings.ToLower(d.Name)))
}

return
Expand Down

0 comments on commit bfe2397

Please sign in to comment.