From 1513ce035b038c251f7e954b2ea045446e8ce1d0 Mon Sep 17 00:00:00 2001 From: Lee ByeongJun Date: Mon, 30 Sep 2024 12:19:58 +0900 Subject: [PATCH] fix --- internal/fixer/fixer.go | 2 +- internal/lints/cyclomatic_complexity.go | 1 - internal/lints/simplify_slice_expr.go | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/fixer/fixer.go b/internal/fixer/fixer.go index 3357b06..2d864cb 100644 --- a/internal/fixer/fixer.go +++ b/internal/fixer/fixer.go @@ -82,7 +82,7 @@ func (f *Fixer) Fix(filename string, issues []tt.Issue) error { return nil } -func (c *Fixer) extractIndent(line string) string { +func (f *Fixer) extractIndent(line string) string { return line[:len(line)-len(strings.TrimLeft(line, " \t"))] } diff --git a/internal/lints/cyclomatic_complexity.go b/internal/lints/cyclomatic_complexity.go index 0d5bd8b..c4cddd2 100644 --- a/internal/lints/cyclomatic_complexity.go +++ b/internal/lints/cyclomatic_complexity.go @@ -30,7 +30,6 @@ func DetectHighCyclomaticComplexity(filename string, threshold int) ([]tt.Issue, for _, stat := range stats { if stat.Complexity > threshold { - funcNode, ok := funcNodes[stat.FuncName] if !ok { continue diff --git a/internal/lints/simplify_slice_expr.go b/internal/lints/simplify_slice_expr.go index 87043c5..e0e5bb6 100644 --- a/internal/lints/simplify_slice_expr.go +++ b/internal/lints/simplify_slice_expr.go @@ -1,3 +1,4 @@ +//nolint:goconst package lints import (