.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / lint_test.go
1 package staticcheck
2
3 import (
4         "testing"
5
6         "honnef.co/go/tools/lint/testutil"
7 )
8
9 func TestAll(t *testing.T) {
10         checks := map[string][]testutil.Test{
11                 "SA1000": {{Dir: "CheckRegexps"}},
12                 "SA1001": {{Dir: "CheckTemplate"}},
13                 "SA1002": {{Dir: "CheckTimeParse"}},
14                 "SA1003": {{Dir: "CheckEncodingBinary"}, {Dir: "CheckEncodingBinary_go17", Version: "1.7"}, {Dir: "CheckEncodingBinary_go18", Version: "1.8"}},
15                 "SA1004": {{Dir: "CheckTimeSleepConstant"}},
16                 "SA1005": {{Dir: "CheckExec"}},
17                 "SA1006": {{Dir: "CheckUnsafePrintf"}},
18                 "SA1007": {{Dir: "CheckURLs"}},
19                 "SA1008": {{Dir: "CheckCanonicalHeaderKey"}},
20                 "SA1010": {{Dir: "checkStdlibUsageRegexpFindAll"}},
21                 "SA1011": {{Dir: "checkStdlibUsageUTF8Cutset"}},
22                 "SA1012": {{Dir: "checkStdlibUsageNilContext"}},
23                 "SA1013": {{Dir: "checkStdlibUsageSeeker"}},
24                 "SA1014": {{Dir: "CheckUnmarshalPointer"}},
25                 "SA1015": {{Dir: "CheckLeakyTimeTick"}, {Dir: "CheckLeakyTimeTick-main"}},
26                 "SA1016": {{Dir: "CheckUntrappableSignal"}},
27                 "SA1017": {{Dir: "CheckUnbufferedSignalChan"}},
28                 "SA1018": {{Dir: "CheckStringsReplaceZero"}},
29                 "SA1019": {
30                         {Dir: "CheckDeprecated"},
31                         {Dir: "CheckDeprecated_go13", Version: "1.3"},
32                         {Dir: "CheckDeprecated_go14", Version: "1.4"},
33                         {Dir: "CheckDeprecated_go18", Version: "1.8"},
34                 },
35                 "SA1020": {{Dir: "CheckListenAddress"}},
36                 "SA1021": {{Dir: "CheckBytesEqualIP"}},
37                 "SA1023": {{Dir: "CheckWriterBufferModified"}},
38                 "SA1024": {{Dir: "CheckNonUniqueCutset"}},
39                 "SA1025": {{Dir: "CheckTimerResetReturnValue"}},
40                 "SA1026": {{Dir: "CheckUnsupportedMarshal"}},
41                 "SA1027": {{Dir: "CheckAtomicAlignment"}},
42                 "SA1028": {{Dir: "CheckSortSlice"}},
43                 "SA1029": {{Dir: "CheckWithValueKey"}},
44                 "SA2000": {{Dir: "CheckWaitgroupAdd"}},
45                 "SA2001": {{Dir: "CheckEmptyCriticalSection"}},
46                 "SA2002": {{Dir: "CheckConcurrentTesting"}},
47                 "SA2003": {{Dir: "CheckDeferLock"}},
48                 "SA3000": {
49                         {Dir: "CheckTestMainExit-1_go14", Version: "1.4"},
50                         {Dir: "CheckTestMainExit-2_go14", Version: "1.4"},
51                         {Dir: "CheckTestMainExit-3_go14", Version: "1.4"},
52                         {Dir: "CheckTestMainExit-4_go14", Version: "1.4"},
53                         {Dir: "CheckTestMainExit-5_go14", Version: "1.4"},
54                         {Dir: "CheckTestMainExit-1_go115", Version: "1.15"},
55                 },
56                 "SA3001": {{Dir: "CheckBenchmarkN"}},
57                 "SA4000": {{Dir: "CheckLhsRhsIdentical"}},
58                 "SA4001": {{Dir: "CheckIneffectiveCopy"}},
59                 "SA4003": {{Dir: "CheckExtremeComparison"}},
60                 "SA4004": {{Dir: "CheckIneffectiveLoop"}},
61                 "SA4006": {{Dir: "CheckUnreadVariableValues"}},
62                 "SA4008": {{Dir: "CheckLoopCondition"}},
63                 "SA4009": {{Dir: "CheckArgOverwritten"}},
64                 "SA4010": {{Dir: "CheckIneffectiveAppend"}},
65                 "SA4011": {{Dir: "CheckScopedBreak"}},
66                 "SA4012": {{Dir: "CheckNaNComparison"}},
67                 "SA4013": {{Dir: "CheckDoubleNegation"}},
68                 "SA4014": {{Dir: "CheckRepeatedIfElse"}},
69                 "SA4015": {{Dir: "CheckMathInt"}},
70                 "SA4016": {{Dir: "CheckSillyBitwiseOps"}, {Dir: "CheckSillyBitwiseOps_shadowedIota"}, {Dir: "CheckSillyBitwiseOps_dotImport"}},
71                 "SA4017": {{Dir: "CheckPureFunctions"}},
72                 "SA4018": {{Dir: "CheckSelfAssignment"}},
73                 "SA4019": {{Dir: "CheckDuplicateBuildConstraints"}},
74                 "SA4020": {{Dir: "CheckUnreachableTypeCases"}},
75                 "SA4021": {{Dir: "CheckSingleArgAppend"}},
76                 "SA4022": {{Dir: "CheckAddressIsNil"}},
77                 "SA4023": {
78                         {Dir: "CheckTypedNilInterface"},
79                         {Dir: "CheckTypedNilInterface/i26000"},
80                         {Dir: "CheckTypedNilInterface/i27815"},
81                         {Dir: "CheckTypedNilInterface/i28241"},
82                         {Dir: "CheckTypedNilInterface/i31873"},
83                         {Dir: "CheckTypedNilInterface/i33965"},
84                         {Dir: "CheckTypedNilInterface/i33994"},
85                         {Dir: "CheckTypedNilInterface/i35217"},
86                 },
87                 "SA5000": {{Dir: "CheckNilMaps"}},
88                 "SA5001": {{Dir: "CheckEarlyDefer"}},
89                 "SA5002": {{Dir: "CheckInfiniteEmptyLoop"}},
90                 "SA5003": {{Dir: "CheckDeferInInfiniteLoop"}},
91                 "SA5004": {{Dir: "CheckLoopEmptyDefault"}},
92                 "SA5005": {{Dir: "CheckCyclicFinalizer"}},
93                 "SA5007": {{Dir: "CheckInfiniteRecursion"}},
94                 "SA5008": {{Dir: "CheckStructTags"}, {Dir: "CheckStructTags2"}, {Dir: "CheckStructTags3"}},
95                 "SA5009": {{Dir: "CheckPrintf"}},
96                 "SA5010": {{Dir: "CheckImpossibleTypeAssertion"}},
97                 "SA5011": {{Dir: "CheckMaybeNil"}},
98                 "SA5012": {{Dir: "CheckEvenSliceLength"}},
99                 "SA6000": {{Dir: "CheckRegexpMatchLoop"}},
100                 "SA6001": {{Dir: "CheckMapBytesKey"}},
101                 "SA6002": {{Dir: "CheckSyncPoolValue"}},
102                 "SA6003": {{Dir: "CheckRangeStringRunes"}},
103                 "SA6005": {{Dir: "CheckToLowerToUpperComparison"}},
104                 "SA9001": {{Dir: "CheckDubiousDeferInChannelRangeLoop"}},
105                 "SA9002": {{Dir: "CheckNonOctalFileMode"}},
106                 "SA9003": {{Dir: "CheckEmptyBranch"}},
107                 "SA9004": {{Dir: "CheckMissingEnumTypesInDeclaration"}},
108                 "SA9005": {{Dir: "CheckNoopMarshal"}},
109                 "SA9006": {{Dir: "CheckStaticBitShift"}},
110         }
111
112         testutil.Run(t, Analyzers, checks)
113 }