Skip to content

Commit

Permalink
Merge pull request #43 from ldez/fix/panic
Browse files Browse the repository at this point in the history
fix: index out of range
  • Loading branch information
yeya24 committed Apr 21, 2024
2 parents 48db570 + ced60a7 commit 87286a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions promlinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ func (v *visitor) parseSendMetricChanExpr(chExpr *ast.SendStmt) ast.Visitor {
return v
}

if len(call.Args) == 0 {
return v
}

name, help := v.parseConstMetricOptsExpr(call.Args[0])
if name == nil {
return v
Expand Down

0 comments on commit 87286a7

Please sign in to comment.