Skip to content

Commit 4133655

Browse files
feat: add check idx
1 parent 7b73505 commit 4133655

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/analyzer/analyzer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ func getBasicLitFromArgs(args []ast.Expr, count, idx int, typ token.Token) *ast.
414414
return nil
415415
}
416416

417+
if idx > count-1 {
418+
return nil
419+
}
420+
417421
basicLit, ok := args[idx].(*ast.BasicLit)
418422
if !ok {
419423
return nil

0 commit comments

Comments
 (0)