Skip to content

Commit ade4167

Browse files
committed
clean up lint
1 parent 329c2bf commit ade4167

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

data/message.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ type Message struct {
2222
Messages []*Message
2323
// OneOfFieldsGroups is the grouped list of one of fields with same index. so
2424
// that renderer can render the clearing of other fields on set.
25-
OneOfFieldsGroups map[int32][]*Field
25+
OneOfFieldsGroups map[int][]*Field
2626
// OneOfFieldNames is the names of one of fields with same index. so that
2727
// renderer can render the clearing of other fields on set.
28-
OneOfFieldsNames map[int32]string
28+
OneOfFieldsNames map[int]string
2929
}
3030

3131
// HasOneOfFields returns true when the message has a one of field.
@@ -57,8 +57,8 @@ func NewMessage() *Message {
5757
Enums: make([]*NestedEnum, 0),
5858
Fields: make([]*Field, 0),
5959
Messages: make([]*Message, 0),
60-
OneOfFieldsGroups: make(map[int32][]*Field),
61-
OneOfFieldsNames: make(map[int32]string),
60+
OneOfFieldsGroups: make(map[int][]*Field),
61+
OneOfFieldsNames: make(map[int]string),
6262
}
6363
}
6464

@@ -97,7 +97,7 @@ type Field struct {
9797
// Message is the reference back to the parent message
9898
Message *Message
9999
// OneOfIndex is the index in the one of fields
100-
OneOfIndex int32
100+
OneOfIndex int
101101
// IsRepeated indicates whether the field is a repeated field
102102
IsRepeated bool
103103
}

registry/field.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (r *Registry) analyseField(
9292
// if it's a one of field. register the field data in the group of the same one of index.
9393
// internally, optional fields are modeled as OneOf, however, we don't want to include them here.
9494
if fieldData.IsOneOfField && !fieldData.IsOptional {
95-
index := f.GetOneofIndex()
95+
index := int(f.GetOneofIndex())
9696
fieldData.OneOfIndex = index
9797
_, ok := msgData.OneOfFieldsGroups[index]
9898
if !ok {

registry/message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (r *Registry) analyseMessage(
7575

7676
// store a map of one of names
7777
for idx, oneOf := range message.GetOneofDecl() {
78-
data.OneOfFieldsNames[int32(idx)] = oneOf.GetName()
78+
data.OneOfFieldsNames[idx] = oneOf.GetName()
7979
}
8080

8181
// analyse fields in the messages

0 commit comments

Comments
 (0)