From ced60a7ff7c6bed7ad1972577deac3403e2c939f Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sat, 20 Apr 2024 01:06:26 +0200 Subject: [PATCH] fix: index out of range --- promlinter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/promlinter.go b/promlinter.go index 2ed4d60..2418d78 100644 --- a/promlinter.go +++ b/promlinter.go @@ -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