Skip to content

Commit

Permalink
fix rpc meta key
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemalin committed Aug 26, 2021
1 parent 67e7612 commit 2486dce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pb_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ func parsePbMetaFromType(t reflect.Type) []*PbFieldMeta {
return nil
}

metas := make([]*PbFieldMeta, size)
metas := make([]*PbFieldMeta, 0)
for i := 0; i < size; i++ {
tagstruct := t.Field(i).Tag

// check if if map
pbtag := tagstruct.Get("protobuf")
meta := parseMetaString(pbtag)
if meta != nil {
metas[i] = meta
metas = append(metas, meta)
mapKey := tagstruct.Get("protobuf_key")
mapValue := tagstruct.Get("protobuf_val")
if len(mapKey) > 0 && len(mapValue) > 0 {
Expand Down

0 comments on commit 2486dce

Please sign in to comment.