Skip to content

Commit

Permalink
消息id生成时, 使用全小写消息名, 避免不同平台生成问题
Browse files Browse the repository at this point in the history
  • Loading branch information
davyxu committed Oct 30, 2020
1 parent 610dd1d commit d3e6d57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion msgidutil/msgid.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/davyxu/protoplus/model"
"io/ioutil"
"os"
"strings"
)

var skipDupCacheMsgIDTips bool // 跳过重复缓存消息ID的警告提示
Expand Down Expand Up @@ -174,7 +175,7 @@ func StructMsgID(d *model.Descriptor) (msgid int) {
if *flagAutoMsgIDCacheFile != "" {
msgid = autogenMsgIDByCacheFile(*flagAutoMsgIDCacheFile, d)
} else if msgid == 0 {
msgid = int(StringHash(d.DescriptorSet.PackageName + d.Name + *flagMsgIDSalt))
msgid = int(StringHash(strings.ToLower(d.DescriptorSet.PackageName + d.Name + *flagMsgIDSalt)))
}

if *flagCheckDuplicateMsgID {
Expand Down

0 comments on commit d3e6d57

Please sign in to comment.