Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 committed Jun 20, 2024
1 parent dbb2e9a commit 0f05588
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dataplane/apigen/docparser/docparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ func parseInitializer(i int, vals []EnumValue) (val int, rerr error) {
}
if strings.Contains(init, "+") {
splits := strings.Split(init, "+")
if len(splits) != 2 {
return 0, fmt.Errorf("invalid init format expected A + B", init)

Check failure on line 233 in dataplane/apigen/docparser/docparser.go

View workflow job for this annotation

GitHub Actions / lint

printf: fmt.Errorf call has arguments but no formatting directives (govet)
}
lhs := strings.TrimSpace(splits[0])
rhs := strings.TrimSpace(splits[1])
rv, err := strconv.ParseUint(rhs, 0, 64)
Expand All @@ -247,6 +250,9 @@ func parseInitializer(i int, vals []EnumValue) (val int, rerr error) {
}
if strings.Contains(init, "<<") {
splits := strings.Split(init, "<<")
if len(splits) != 2 {
return 0, fmt.Errorf("invalid init format expected A + B", init)

Check failure on line 254 in dataplane/apigen/docparser/docparser.go

View workflow job for this annotation

GitHub Actions / lint

printf: fmt.Errorf call has arguments but no formatting directives (govet)
}
lhs := strings.TrimSpace(splits[0])
rhs := strings.TrimSpace(splits[1])
lv, err := strconv.ParseUint(lhs, 0, 64)
Expand Down Expand Up @@ -321,8 +327,6 @@ func parseXMLEntries(members []MemberDef, xmlInfo *SAIInfo) error {
retryEntry = append(retryEntry, enum)
}
}
consts := saiConsts
fmt.Println(consts)
// Retry processing enum once, for enums that refer to other enums.
for _, enum := range retryEntry {
err := processEntry(enum)
Expand Down

0 comments on commit 0f05588

Please sign in to comment.