Skip to content

Commit d6a9b2f

Browse files
refactor: fix unused method receiver
Methods with unused receivers can be a symptom of unfinished refactoring or a bug. To keep the same method signature, omit the receiver name or '_' as it is unused.
1 parent dd86fef commit d6a9b2f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

analysis/ts_scope.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type TsScopeBuilder struct {
1919
unresolvedRefs []UnresolvedRef
2020
}
2121

22-
func (j *TsScopeBuilder) GetLanguage() Language {
22+
func (*TsScopeBuilder) GetLanguage() Language {
2323
return LangJs
2424
}
2525

@@ -37,11 +37,11 @@ var ScopeNodes = []string{
3737
"method_definition",
3838
}
3939

40-
func (ts *TsScopeBuilder) NodeCreatesScope(node *sitter.Node) bool {
40+
func (*TsScopeBuilder) NodeCreatesScope(node *sitter.Node) bool {
4141
return slices.Contains(ScopeNodes, node.Type())
4242
}
4343

44-
func (ts *TsScopeBuilder) DeclaresVariable(node *sitter.Node) bool {
44+
func (*TsScopeBuilder) DeclaresVariable(node *sitter.Node) bool {
4545
typ := node.Type()
4646
return typ == "variable_declarator" ||
4747
typ == "import_clause" ||

pkg/analysis/analyze.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func GatherSkipInfo(fileContext *ParseResult) []*SkipComment {
405405
return skipLines
406406
}
407407

408-
func (ana *Analyzer) ContainsSkipcq(skipLines []*SkipComment, issue *Issue) bool {
408+
func (*Analyzer) ContainsSkipcq(skipLines []*SkipComment, issue *Issue) bool {
409409
if len(skipLines) == 0 {
410410
return false
411411
}

pkg/analysis/scope_ts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type TsScopeBuilder struct {
1919
unresolvedRefs []UnresolvedRef
2020
}
2121

22-
func (j *TsScopeBuilder) GetLanguage() Language {
22+
func (*TsScopeBuilder) GetLanguage() Language {
2323
return LangJs
2424
}
2525

@@ -33,11 +33,11 @@ var ScopeNodes = []string{
3333
"program",
3434
}
3535

36-
func (ts *TsScopeBuilder) NodeCreatesScope(node *sitter.Node) bool {
36+
func (*TsScopeBuilder) NodeCreatesScope(node *sitter.Node) bool {
3737
return slices.Contains(ScopeNodes, node.Type())
3838
}
3939

40-
func (ts *TsScopeBuilder) DeclaresVariable(node *sitter.Node) bool {
40+
func (*TsScopeBuilder) DeclaresVariable(node *sitter.Node) bool {
4141
typ := node.Type()
4242
// addition of function_declaration and formal_parameters necessary for functional scope handling.
4343
return typ == "variable_declarator" || typ == "import_clause" || typ == "import_specifier" || typ == "formal_parameters" || typ == "function_declaration"

0 commit comments

Comments
 (0)