From d81298b0ce18fe99d40484266ffa45106a7b7ad8 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Sat, 15 Nov 2025 20:24:16 +0200 Subject: [PATCH] test: fix testpackage lint issues for test and ifelse (#1582) --- .golangci.yml | 13 +++ internal/ifelse/branch_test.go | 84 ++++++++++---------- test/add_constant_test.go | 2 +- test/argument_limit_test.go | 2 +- test/atomic_test.go | 2 +- test/banned_characters_test.go | 2 +- test/bare_return_test.go | 2 +- test/bool_literal_in_expr_test.go | 2 +- test/call_to_gc_test.go | 2 +- test/cognitive_complexity_test.go | 2 +- test/comment_spacings_test.go | 2 +- test/comments_density_test.go | 2 +- test/confusing_naming_test.go | 2 +- test/confusing_results_test.go | 2 +- test/constant_logical_expr_test.go | 2 +- test/context_as_argument_test.go | 2 +- test/cyclomatic_test.go | 2 +- test/datarace_test.go | 2 +- test/deep_exit_test.go | 2 +- test/defer_test.go | 2 +- test/disable_annotations_test.go | 2 +- test/dot_imports_test.go | 2 +- test/duplicated_imports_test.go | 2 +- test/early_return_test.go | 2 +- test/empty_block_test.go | 2 +- test/empty_lines_test.go | 2 +- test/enforce_map_style_test.go | 2 +- test/enforce_repeated_arg_type_style_test.go | 2 +- test/enforce_slice_style_test.go | 2 +- test/enforce_switch_style_test.go | 2 +- test/error_strings_custom_functions_test.go | 2 +- test/exported_test.go | 2 +- test/file_filter_test.go | 2 +- test/file_header_test.go | 2 +- test/file_length_limit_test.go | 2 +- test/filename_format_test.go | 2 +- test/flag_param_test.go | 2 +- test/forbidden_call_in_wg_go_test.go | 2 +- test/function_length_test.go | 2 +- test/function_result_limit_test.go | 2 +- test/get_return_test.go | 2 +- test/golint_test.go | 2 +- test/identical_branches_test.go | 2 +- test/identical_ifelseif_branches_test.go | 2 +- test/identical_ifelseif_conditions_test.go | 2 +- test/identical_switch_branches_test.go | 2 +- test/identical_switch_conditions_test.go | 2 +- test/if_return_test.go | 2 +- test/import_alias_naming_test.go | 2 +- test/import_shadowing_test.go | 2 +- test/imports_blocklist_test.go | 2 +- test/indent_error_flow_test.go | 2 +- test/inefficient_map_lookup_test.go | 2 +- test/issue1100_test.go | 2 +- test/json_data_format_test.go | 2 +- test/line_length_limit_test.go | 2 +- test/max_control_nesting_test.go | 2 +- test/max_public_structs_test.go | 2 +- test/modifies_param_test.go | 2 +- test/modifies_value_receiver_test.go | 2 +- test/nested_structs_test.go | 2 +- test/optimize_operands_order_test.go | 2 +- test/package_directory_mismatch_test.go | 2 +- test/range_val_address_test.go | 2 +- test/range_val_in_closure_test.go | 2 +- test/receiver_naming_test.go | 2 +- test/redefines_builtin_id_test.go | 2 +- test/redundant_build_tag_test.go | 2 +- test/redundant_import_alias_test.go | 2 +- test/redundant_test_main_exit_test.go | 2 +- test/string_format_test.go | 2 +- test/string_of_int_test.go | 2 +- test/struct_tag_test.go | 2 +- test/superfluous_else_test.go | 2 +- test/time_date_test.go | 2 +- test/time_equal_test.go | 2 +- test/time_naming_test.go | 2 +- test/unchecked_type_assertion_test.go | 2 +- test/unconditional_recursion_test.go | 2 +- test/unexported_naming_test.go | 2 +- test/unexported_return_test.go | 2 +- test/unhandled_error_test.go | 2 +- test/unnecessary_format_test.go | 2 +- test/unnecessary_if_test.go | 2 +- test/unnecessary_stmt_test.go | 2 +- test/unreachable_code_test.go | 2 +- test/unsecure_url_scheme_test.go | 2 +- test/unused_param_test.go | 2 +- test/unused_receiver_test.go | 2 +- test/use_any_test.go | 2 +- test/use_errors_new_test.go | 2 +- test/use_fmt_print_test.go | 2 +- test/use_waitgroup_go_test.go | 2 +- test/useless_break_test.go | 2 +- test/useless_fallthrough_test.go | 2 +- test/utils_test.go | 2 +- test/var_naming_test.go | 2 +- test/waitgroup_by_value_test.go | 2 +- 98 files changed, 152 insertions(+), 137 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d8abf70..c98d308 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,7 @@ linters: - musttag - nolintlint - revive + - testpackage - thelper - staticcheck - unparam @@ -30,6 +31,18 @@ linters: - linters: - godoclint text: 'symbol should have a godoc \("Visit"\)' + - linters: + - testpackage + text: 'package should be `rule_test` instead of `rule`' + - linters: + - testpackage + text: 'package should be `lint_test` instead of `lint`' + - linters: + - testpackage + text: 'package should be `cli_test` instead of `cli`' + - linters: + - testpackage + text: 'package should be `formatter_test` instead of `formatter`' settings: gocritic: diff --git a/internal/ifelse/branch_test.go b/internal/ifelse/branch_test.go index dd07776..f38ba30 100644 --- a/internal/ifelse/branch_test.go +++ b/internal/ifelse/branch_test.go @@ -1,24 +1,26 @@ -package ifelse +package ifelse_test import ( "go/ast" "go/token" "testing" + + "github.com/mgechev/revive/internal/ifelse" ) func TestBlockBranch(t *testing.T) { t.Run("empty", func(t *testing.T) { block := &ast.BlockStmt{List: []ast.Stmt{}} - b := BlockBranch(block) - if b.BranchKind != Empty { + b := ifelse.BlockBranch(block) + if b.BranchKind != ifelse.Empty { t.Errorf("want Empty branch, got %v", b.BranchKind) } }) t.Run("non empty", func(t *testing.T) { stmt := &ast.ReturnStmt{} block := &ast.BlockStmt{List: []ast.Stmt{stmt}} - b := BlockBranch(block) - if b.BranchKind != Return { + b := ifelse.BlockBranch(block) + if b.BranchKind != ifelse.Return { t.Errorf("want Return branch, got %v", b.BranchKind) } }) @@ -28,33 +30,33 @@ func TestStmtBranch(t *testing.T) { cases := []struct { name string stmt ast.Stmt - kind BranchKind - call *Call + kind ifelse.BranchKind + call *ifelse.Call }{ { name: "ReturnStmt", stmt: &ast.ReturnStmt{}, - kind: Return, + kind: ifelse.Return, }, { name: "BreakStmt", stmt: &ast.BranchStmt{Tok: token.BREAK}, - kind: Break, + kind: ifelse.Break, }, { name: "ContinueStmt", stmt: &ast.BranchStmt{Tok: token.CONTINUE}, - kind: Continue, + kind: ifelse.Continue, }, { name: "GotoStmt", stmt: &ast.BranchStmt{Tok: token.GOTO}, - kind: Goto, + kind: ifelse.Goto, }, { name: "EmptyStmt", stmt: &ast.EmptyStmt{}, - kind: Empty, + kind: ifelse.Empty, }, { name: "ExprStmt with DeviatingFunc (panic)", @@ -63,8 +65,8 @@ func TestStmtBranch(t *testing.T) { Fun: &ast.Ident{Name: "panic"}, }, }, - kind: Panic, - call: &Call{Name: "panic"}, + kind: ifelse.Panic, + call: &ifelse.Call{Name: "panic"}, }, { name: "ExprStmt with DeviatingFunc (os.Exit)", @@ -76,8 +78,8 @@ func TestStmtBranch(t *testing.T) { }, }, }, - kind: Exit, - call: &Call{Pkg: "os", Name: "Exit"}, + kind: ifelse.Exit, + call: &ifelse.Call{Pkg: "os", Name: "Exit"}, }, { name: "ExprStmt with non-deviating func", @@ -86,7 +88,7 @@ func TestStmtBranch(t *testing.T) { Fun: &ast.Ident{Name: "foo"}, }, }, - kind: Regular, + kind: ifelse.Regular, }, { name: "LabeledStmt wrapping ReturnStmt", @@ -94,7 +96,7 @@ func TestStmtBranch(t *testing.T) { Label: &ast.Ident{Name: "lbl"}, Stmt: &ast.ReturnStmt{}, }, - kind: Return, + kind: ifelse.Return, }, { name: "LabeledStmt wrapping ExprStmt", @@ -102,21 +104,21 @@ func TestStmtBranch(t *testing.T) { Label: &ast.Ident{Name: "lbl"}, Stmt: &ast.ExprStmt{X: &ast.CallExpr{Fun: &ast.Ident{Name: "foo"}}}, }, - kind: Regular, + kind: ifelse.Regular, }, { name: "BlockStmt with ReturnStmt", stmt: &ast.BlockStmt{List: []ast.Stmt{&ast.ReturnStmt{}}}, - kind: Return, + kind: ifelse.Return, }, { name: "BlockStmt with ExprStmt", stmt: &ast.BlockStmt{List: []ast.Stmt{&ast.ExprStmt{X: &ast.CallExpr{Fun: &ast.Ident{Name: "foo"}}}}}, - kind: Regular, + kind: ifelse.Regular, }, } for _, c := range cases { - b := StmtBranch(c.stmt) + b := ifelse.StmtBranch(c.stmt) if b.BranchKind != c.kind { t.Errorf("%s: want %v, got %v", c.name, c.kind, b.BranchKind) } @@ -131,37 +133,37 @@ func TestStmtBranch(t *testing.T) { func TestBranch_String_LongString(t *testing.T) { tests := []struct { name string - branch Branch + branch ifelse.Branch wantStr string wantLong string }{ { name: "Return branch", - branch: Branch{BranchKind: Return}, + branch: ifelse.Branch{BranchKind: ifelse.Return}, wantStr: "{ ... return }", wantLong: "a return statement", }, { name: "Panic branch with Call", - branch: Branch{BranchKind: Panic, Call: Call{Name: "panic"}}, + branch: ifelse.Branch{BranchKind: ifelse.Panic, Call: ifelse.Call{Name: "panic"}}, wantStr: "{ ... panic() }", wantLong: "call to panic function", }, { name: "Exit branch with Call", - branch: Branch{BranchKind: Exit, Call: Call{Pkg: "os", Name: "Exit"}}, + branch: ifelse.Branch{BranchKind: ifelse.Exit, Call: ifelse.Call{Pkg: "os", Name: "Exit"}}, wantStr: "{ ... os.Exit() }", wantLong: "call to os.Exit function", }, { name: "Empty branch", - branch: Branch{BranchKind: Empty}, + branch: ifelse.Branch{BranchKind: ifelse.Empty}, wantStr: "{ }", wantLong: "an empty block", }, { name: "Regular branch", - branch: Branch{BranchKind: Regular}, + branch: ifelse.Branch{BranchKind: ifelse.Regular}, wantStr: "{ ... }", wantLong: "a regular statement", }, @@ -179,27 +181,27 @@ func TestBranch_String_LongString(t *testing.T) { func TestBranch_HasDecls(t *testing.T) { tests := []struct { name string - block []ast.Stmt + block *ast.BlockStmt want bool }{ { name: "DeclStmt", - block: []ast.Stmt{&ast.DeclStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.DeclStmt{}}}, want: true, }, { name: "AssignStmt with :=", - block: []ast.Stmt{&ast.AssignStmt{Tok: token.DEFINE}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.AssignStmt{Tok: token.DEFINE}}}, want: true, }, { name: "ExprStmt", - block: []ast.Stmt{&ast.ExprStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.ExprStmt{}}}, want: false, }, } for _, tt := range tests { - b := Branch{block: tt.block} + b := ifelse.BlockBranch(tt.block) if got := b.HasDecls(); got != tt.want { t.Errorf("%s: want HasDecls to be %v, got %v", tt.name, tt.want, got) } @@ -209,42 +211,42 @@ func TestBranch_HasDecls(t *testing.T) { func TestBranch_IsShort(t *testing.T) { tests := []struct { name string - block []ast.Stmt + block *ast.BlockStmt want bool }{ { name: "nil block", - block: nil, + block: &ast.BlockStmt{}, want: true, }, { name: "single ExprStmt", - block: []ast.Stmt{&ast.ExprStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.ExprStmt{}}}, want: true, }, { name: "single BlockStmt", - block: []ast.Stmt{&ast.BlockStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.BlockStmt{}}}, want: false, }, { name: "two short statements", - block: []ast.Stmt{&ast.ExprStmt{}, &ast.ExprStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.ExprStmt{}, &ast.ExprStmt{}}}, want: true, }, { name: "second non-short statement", - block: []ast.Stmt{&ast.ExprStmt{}, &ast.BlockStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.ExprStmt{}, &ast.BlockStmt{}}}, want: false, }, { name: "three statements (should return false)", - block: []ast.Stmt{&ast.ExprStmt{}, &ast.ExprStmt{}, &ast.ExprStmt{}}, + block: &ast.BlockStmt{List: []ast.Stmt{&ast.ExprStmt{}, &ast.ExprStmt{}, &ast.ExprStmt{}}}, want: false, }, } for _, tt := range tests { - b := Branch{block: tt.block} + b := ifelse.BlockBranch(tt.block) if got := b.IsShort(); got != tt.want { t.Errorf("%s: want IsShort to be %v, got %v", tt.name, tt.want, got) } diff --git a/test/add_constant_test.go b/test/add_constant_test.go index 3f2105f..b1e9e90 100644 --- a/test/add_constant_test.go +++ b/test/add_constant_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/argument_limit_test.go b/test/argument_limit_test.go index b89b0ec..39a602c 100644 --- a/test/argument_limit_test.go +++ b/test/argument_limit_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/atomic_test.go b/test/atomic_test.go index 2da7bef..bbe517b 100644 --- a/test/atomic_test.go +++ b/test/atomic_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/banned_characters_test.go b/test/banned_characters_test.go index bbd756b..800f3aa 100644 --- a/test/banned_characters_test.go +++ b/test/banned_characters_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/bare_return_test.go b/test/bare_return_test.go index 4049efc..4c7286e 100644 --- a/test/bare_return_test.go +++ b/test/bare_return_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/bool_literal_in_expr_test.go b/test/bool_literal_in_expr_test.go index 501db69..da163bd 100644 --- a/test/bool_literal_in_expr_test.go +++ b/test/bool_literal_in_expr_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/call_to_gc_test.go b/test/call_to_gc_test.go index 5944a9d..0330dec 100644 --- a/test/call_to_gc_test.go +++ b/test/call_to_gc_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/cognitive_complexity_test.go b/test/cognitive_complexity_test.go index 4524240..b4afb78 100644 --- a/test/cognitive_complexity_test.go +++ b/test/cognitive_complexity_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/comment_spacings_test.go b/test/comment_spacings_test.go index 4a1300c..a7a3d6b 100644 --- a/test/comment_spacings_test.go +++ b/test/comment_spacings_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/comments_density_test.go b/test/comments_density_test.go index df72ff8..fef702f 100644 --- a/test/comments_density_test.go +++ b/test/comments_density_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/confusing_naming_test.go b/test/confusing_naming_test.go index ce60d92..c05e46d 100644 --- a/test/confusing_naming_test.go +++ b/test/confusing_naming_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/confusing_results_test.go b/test/confusing_results_test.go index 38d64e6..e44b6bb 100644 --- a/test/confusing_results_test.go +++ b/test/confusing_results_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/constant_logical_expr_test.go b/test/constant_logical_expr_test.go index ce53098..72dd320 100644 --- a/test/constant_logical_expr_test.go +++ b/test/constant_logical_expr_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/context_as_argument_test.go b/test/context_as_argument_test.go index 7e37e6a..166a7cc 100644 --- a/test/context_as_argument_test.go +++ b/test/context_as_argument_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/cyclomatic_test.go b/test/cyclomatic_test.go index b09f1c0..2c39309 100644 --- a/test/cyclomatic_test.go +++ b/test/cyclomatic_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/datarace_test.go b/test/datarace_test.go index dfec5e9..b753073 100644 --- a/test/datarace_test.go +++ b/test/datarace_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/deep_exit_test.go b/test/deep_exit_test.go index af57efe..3b03cd1 100644 --- a/test/deep_exit_test.go +++ b/test/deep_exit_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/defer_test.go b/test/defer_test.go index 4155e3f..dbf188c 100644 --- a/test/defer_test.go +++ b/test/defer_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/disable_annotations_test.go b/test/disable_annotations_test.go index be913b4..8e889c8 100644 --- a/test/disable_annotations_test.go +++ b/test/disable_annotations_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/dot_imports_test.go b/test/dot_imports_test.go index 5dc9965..aaeda3d 100644 --- a/test/dot_imports_test.go +++ b/test/dot_imports_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/duplicated_imports_test.go b/test/duplicated_imports_test.go index d4b4be9..c7d58b1 100644 --- a/test/duplicated_imports_test.go +++ b/test/duplicated_imports_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/early_return_test.go b/test/early_return_test.go index 114f0f7..33e8788 100644 --- a/test/early_return_test.go +++ b/test/early_return_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/empty_block_test.go b/test/empty_block_test.go index c5b8c5b..f139e52 100644 --- a/test/empty_block_test.go +++ b/test/empty_block_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/empty_lines_test.go b/test/empty_lines_test.go index faad9b7..d2494d6 100644 --- a/test/empty_lines_test.go +++ b/test/empty_lines_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/enforce_map_style_test.go b/test/enforce_map_style_test.go index dd36ff2..890842b 100644 --- a/test/enforce_map_style_test.go +++ b/test/enforce_map_style_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/enforce_repeated_arg_type_style_test.go b/test/enforce_repeated_arg_type_style_test.go index f5b19be..a79d9d9 100644 --- a/test/enforce_repeated_arg_type_style_test.go +++ b/test/enforce_repeated_arg_type_style_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/enforce_slice_style_test.go b/test/enforce_slice_style_test.go index b0ee568..ba4e614 100644 --- a/test/enforce_slice_style_test.go +++ b/test/enforce_slice_style_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/enforce_switch_style_test.go b/test/enforce_switch_style_test.go index 2653f2b..2c1953e 100644 --- a/test/enforce_switch_style_test.go +++ b/test/enforce_switch_style_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/error_strings_custom_functions_test.go b/test/error_strings_custom_functions_test.go index 255e06e..70d1b3f 100644 --- a/test/error_strings_custom_functions_test.go +++ b/test/error_strings_custom_functions_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/exported_test.go b/test/exported_test.go index dd8ffc7..1e1765f 100644 --- a/test/exported_test.go +++ b/test/exported_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/file_filter_test.go b/test/file_filter_test.go index 6efdc31..4c8a1df 100644 --- a/test/file_filter_test.go +++ b/test/file_filter_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/file_header_test.go b/test/file_header_test.go index 71d0840..ad0af7f 100644 --- a/test/file_header_test.go +++ b/test/file_header_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/file_length_limit_test.go b/test/file_length_limit_test.go index 1414b21..134bdcf 100644 --- a/test/file_length_limit_test.go +++ b/test/file_length_limit_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/filename_format_test.go b/test/filename_format_test.go index 6cd364f..ada96d2 100644 --- a/test/filename_format_test.go +++ b/test/filename_format_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/flag_param_test.go b/test/flag_param_test.go index 62bc242..ad97c47 100644 --- a/test/flag_param_test.go +++ b/test/flag_param_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/forbidden_call_in_wg_go_test.go b/test/forbidden_call_in_wg_go_test.go index 74dcd34..e6b5132 100644 --- a/test/forbidden_call_in_wg_go_test.go +++ b/test/forbidden_call_in_wg_go_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/function_length_test.go b/test/function_length_test.go index be7bea1..61627bb 100644 --- a/test/function_length_test.go +++ b/test/function_length_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/function_result_limit_test.go b/test/function_result_limit_test.go index 7bcc41f..061fb05 100644 --- a/test/function_result_limit_test.go +++ b/test/function_result_limit_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/get_return_test.go b/test/get_return_test.go index b0391a3..357b353 100644 --- a/test/get_return_test.go +++ b/test/get_return_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/golint_test.go b/test/golint_test.go index 70dd577..7abf9dc 100644 --- a/test/golint_test.go +++ b/test/golint_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "flag" diff --git a/test/identical_branches_test.go b/test/identical_branches_test.go index 341f981..a447941 100644 --- a/test/identical_branches_test.go +++ b/test/identical_branches_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/identical_ifelseif_branches_test.go b/test/identical_ifelseif_branches_test.go index 82d2f0a..df32b53 100644 --- a/test/identical_ifelseif_branches_test.go +++ b/test/identical_ifelseif_branches_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/identical_ifelseif_conditions_test.go b/test/identical_ifelseif_conditions_test.go index 6708493..197baaa 100644 --- a/test/identical_ifelseif_conditions_test.go +++ b/test/identical_ifelseif_conditions_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/identical_switch_branches_test.go b/test/identical_switch_branches_test.go index ab52ed2..843b61a 100644 --- a/test/identical_switch_branches_test.go +++ b/test/identical_switch_branches_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/identical_switch_conditions_test.go b/test/identical_switch_conditions_test.go index 6e36627..02d4cce 100644 --- a/test/identical_switch_conditions_test.go +++ b/test/identical_switch_conditions_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/if_return_test.go b/test/if_return_test.go index ce23fa0..4cb0371 100644 --- a/test/if_return_test.go +++ b/test/if_return_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/import_alias_naming_test.go b/test/import_alias_naming_test.go index a540f09..d07a082 100644 --- a/test/import_alias_naming_test.go +++ b/test/import_alias_naming_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/import_shadowing_test.go b/test/import_shadowing_test.go index f3512ce..28ba91f 100644 --- a/test/import_shadowing_test.go +++ b/test/import_shadowing_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/imports_blocklist_test.go b/test/imports_blocklist_test.go index e5a20f1..6159369 100644 --- a/test/imports_blocklist_test.go +++ b/test/imports_blocklist_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/indent_error_flow_test.go b/test/indent_error_flow_test.go index 2cc0c67..55ff255 100644 --- a/test/indent_error_flow_test.go +++ b/test/indent_error_flow_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/inefficient_map_lookup_test.go b/test/inefficient_map_lookup_test.go index 35a48d0..28244ba 100644 --- a/test/inefficient_map_lookup_test.go +++ b/test/inefficient_map_lookup_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/issue1100_test.go b/test/issue1100_test.go index 4e3f9f6..0651536 100644 --- a/test/issue1100_test.go +++ b/test/issue1100_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/json_data_format_test.go b/test/json_data_format_test.go index b81a6f5..be9ab30 100644 --- a/test/json_data_format_test.go +++ b/test/json_data_format_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/line_length_limit_test.go b/test/line_length_limit_test.go index 4aad357..d1c2810 100644 --- a/test/line_length_limit_test.go +++ b/test/line_length_limit_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/max_control_nesting_test.go b/test/max_control_nesting_test.go index 38250e2..87ffea4 100644 --- a/test/max_control_nesting_test.go +++ b/test/max_control_nesting_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/max_public_structs_test.go b/test/max_public_structs_test.go index 55718b0..0b1f916 100644 --- a/test/max_public_structs_test.go +++ b/test/max_public_structs_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/modifies_param_test.go b/test/modifies_param_test.go index 2c1d99f..88c5186 100644 --- a/test/modifies_param_test.go +++ b/test/modifies_param_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/modifies_value_receiver_test.go b/test/modifies_value_receiver_test.go index 3d68a10..1bb3c71 100644 --- a/test/modifies_value_receiver_test.go +++ b/test/modifies_value_receiver_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/nested_structs_test.go b/test/nested_structs_test.go index 71f2058..59ec620 100644 --- a/test/nested_structs_test.go +++ b/test/nested_structs_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/optimize_operands_order_test.go b/test/optimize_operands_order_test.go index 2e8c1d4..eb1bbf2 100644 --- a/test/optimize_operands_order_test.go +++ b/test/optimize_operands_order_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/package_directory_mismatch_test.go b/test/package_directory_mismatch_test.go index 097661c..6528930 100644 --- a/test/package_directory_mismatch_test.go +++ b/test/package_directory_mismatch_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/range_val_address_test.go b/test/range_val_address_test.go index 5fa67a1..b3fd8a4 100644 --- a/test/range_val_address_test.go +++ b/test/range_val_address_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/range_val_in_closure_test.go b/test/range_val_in_closure_test.go index fe30107..e83ca84 100644 --- a/test/range_val_in_closure_test.go +++ b/test/range_val_in_closure_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/receiver_naming_test.go b/test/receiver_naming_test.go index da4b969..dcc478a 100644 --- a/test/receiver_naming_test.go +++ b/test/receiver_naming_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/redefines_builtin_id_test.go b/test/redefines_builtin_id_test.go index f8cdf69..07b50af 100644 --- a/test/redefines_builtin_id_test.go +++ b/test/redefines_builtin_id_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/redundant_build_tag_test.go b/test/redundant_build_tag_test.go index 7365870..83770dd 100644 --- a/test/redundant_build_tag_test.go +++ b/test/redundant_build_tag_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/redundant_import_alias_test.go b/test/redundant_import_alias_test.go index 58473df..120b24a 100644 --- a/test/redundant_import_alias_test.go +++ b/test/redundant_import_alias_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/redundant_test_main_exit_test.go b/test/redundant_test_main_exit_test.go index f64d014..33b14ba 100644 --- a/test/redundant_test_main_exit_test.go +++ b/test/redundant_test_main_exit_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/string_format_test.go b/test/string_format_test.go index 2ef4e57..1fb745b 100644 --- a/test/string_format_test.go +++ b/test/string_format_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/string_of_int_test.go b/test/string_of_int_test.go index f01148c..5849f8f 100644 --- a/test/string_of_int_test.go +++ b/test/string_of_int_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/struct_tag_test.go b/test/struct_tag_test.go index 5f521de..a4ecce9 100644 --- a/test/struct_tag_test.go +++ b/test/struct_tag_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/superfluous_else_test.go b/test/superfluous_else_test.go index e5ff7bb..c8d03f4 100644 --- a/test/superfluous_else_test.go +++ b/test/superfluous_else_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/time_date_test.go b/test/time_date_test.go index eb4ba6d..98280eb 100644 --- a/test/time_date_test.go +++ b/test/time_date_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/time_equal_test.go b/test/time_equal_test.go index d574991..0f79878 100644 --- a/test/time_equal_test.go +++ b/test/time_equal_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/time_naming_test.go b/test/time_naming_test.go index d2ea0d8..13219b5 100644 --- a/test/time_naming_test.go +++ b/test/time_naming_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unchecked_type_assertion_test.go b/test/unchecked_type_assertion_test.go index 1cee4da..f114aa3 100644 --- a/test/unchecked_type_assertion_test.go +++ b/test/unchecked_type_assertion_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unconditional_recursion_test.go b/test/unconditional_recursion_test.go index d55b3a8..c20b517 100644 --- a/test/unconditional_recursion_test.go +++ b/test/unconditional_recursion_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unexported_naming_test.go b/test/unexported_naming_test.go index 3020ae1..5b8f9e2 100644 --- a/test/unexported_naming_test.go +++ b/test/unexported_naming_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unexported_return_test.go b/test/unexported_return_test.go index 1516885..336898f 100644 --- a/test/unexported_return_test.go +++ b/test/unexported_return_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unhandled_error_test.go b/test/unhandled_error_test.go index 606f4a1..7bd603b 100644 --- a/test/unhandled_error_test.go +++ b/test/unhandled_error_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unnecessary_format_test.go b/test/unnecessary_format_test.go index 9269e09..c66ce99 100644 --- a/test/unnecessary_format_test.go +++ b/test/unnecessary_format_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unnecessary_if_test.go b/test/unnecessary_if_test.go index f6712b0..afb7f12 100644 --- a/test/unnecessary_if_test.go +++ b/test/unnecessary_if_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unnecessary_stmt_test.go b/test/unnecessary_stmt_test.go index a77b5e8..510aa4d 100644 --- a/test/unnecessary_stmt_test.go +++ b/test/unnecessary_stmt_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unreachable_code_test.go b/test/unreachable_code_test.go index 7442153..65cb856 100644 --- a/test/unreachable_code_test.go +++ b/test/unreachable_code_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unsecure_url_scheme_test.go b/test/unsecure_url_scheme_test.go index b95ee3b..6ec8bcc 100644 --- a/test/unsecure_url_scheme_test.go +++ b/test/unsecure_url_scheme_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unused_param_test.go b/test/unused_param_test.go index c69d84c..6f91391 100644 --- a/test/unused_param_test.go +++ b/test/unused_param_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/unused_receiver_test.go b/test/unused_receiver_test.go index 6177424..dd83677 100644 --- a/test/unused_receiver_test.go +++ b/test/unused_receiver_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/use_any_test.go b/test/use_any_test.go index 6748f8c..29d86da 100644 --- a/test/use_any_test.go +++ b/test/use_any_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/use_errors_new_test.go b/test/use_errors_new_test.go index 135beaa..276d8df 100644 --- a/test/use_errors_new_test.go +++ b/test/use_errors_new_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/use_fmt_print_test.go b/test/use_fmt_print_test.go index e561910..2021e17 100644 --- a/test/use_fmt_print_test.go +++ b/test/use_fmt_print_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/use_waitgroup_go_test.go b/test/use_waitgroup_go_test.go index 482c23c..7294d00 100644 --- a/test/use_waitgroup_go_test.go +++ b/test/use_waitgroup_go_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/useless_break_test.go b/test/useless_break_test.go index 4757dcc..cc7b701 100644 --- a/test/useless_break_test.go +++ b/test/useless_break_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/useless_fallthrough_test.go b/test/useless_fallthrough_test.go index d300f81..9e84170 100644 --- a/test/useless_fallthrough_test.go +++ b/test/useless_fallthrough_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/utils_test.go b/test/utils_test.go index e33a92d..6774fef 100644 --- a/test/utils_test.go +++ b/test/utils_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "encoding/json" diff --git a/test/var_naming_test.go b/test/var_naming_test.go index 44d9746..2b723ab 100644 --- a/test/var_naming_test.go +++ b/test/var_naming_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing" diff --git a/test/waitgroup_by_value_test.go b/test/waitgroup_by_value_test.go index 6b268ae..8f69467 100644 --- a/test/waitgroup_by_value_test.go +++ b/test/waitgroup_by_value_test.go @@ -1,4 +1,4 @@ -package test +package test_test import ( "testing"