Skip to content

Commit

Permalink
fall back to the value in case it's not listed in enum_values
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Van Espen <[email protected]>
  • Loading branch information
Frederic Van Espen committed Aug 31, 2020
1 parent 025cc83 commit fd20382
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,12 @@ func indexOidsAsString(indexOids []int, typ string, fixedSize int, implied bool,
return fmt.Sprintf("%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X", parts...), subOid, indexOids
case "EnumAsInfo":
subOid, indexOids := splitOid(indexOids, 1)
return enumValues[subOid[0]], subOid, indexOids
value, ok := enumValues[subOid[0]]
if ok {
return value, subOid, indexOids
} else {
return fmt.Sprintf("%d", subOid[0]), subOid, indexOids
}
default:
panic(fmt.Sprintf("Unknown index type %s", typ))
return "", nil, nil
Expand Down

0 comments on commit fd20382

Please sign in to comment.