Skip to content

Commit ced60a7

Browse files
committed
fix: index out of range
1 parent 48db570 commit ced60a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

promlinter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ func (v *visitor) parseSendMetricChanExpr(chExpr *ast.SendStmt) ast.Visitor {
347347
return v
348348
}
349349

350+
if len(call.Args) == 0 {
351+
return v
352+
}
353+
350354
name, help := v.parseConstMetricOptsExpr(call.Args[0])
351355
if name == nil {
352356
return v

0 commit comments

Comments
 (0)