@@ -95,6 +95,11 @@ They also detect code that may be correct, but looks suspicious.
95
95
<a href="#nilValReturn-ref">nilValReturn</a>
96
96
</td >
97
97
<td >Detects return statements those results evaluate to nil</td >
98
+ </tr ><tr >
99
+ <td nowrap >:white_check_mark:
100
+ <a href="#octalLiteral-ref">octalLiteral</a>
101
+ </td >
102
+ <td >Detects octal literals passed to functions</td >
98
103
</tr ><tr >
99
104
<td nowrap >:white_check_mark:
100
105
<a href="#offBy1-ref">offBy1</a>
@@ -557,7 +562,15 @@ func f(in int, out *int) (err error) {}
557
562
558
563
559
564
Checker parameters:
560
- * ` @captLocal.paramsOnly ` whether to restrict checker to params only (default true)
565
+ <ul >
566
+ <li >
567
+
568
+ ` @captLocal.paramsOnly ` whether to restrict checker to params only (default true)
569
+
570
+ </li >
571
+
572
+ </ul >
573
+
561
574
562
575
<a name =" caseOrder-ref " ></a >
563
576
## caseOrder
@@ -937,7 +950,15 @@ if cond1 {
937
950
938
951
939
952
Checker parameters:
940
- * ` @elseif.skipBalanced ` whether to skip balanced if-else pairs (default true)
953
+ <ul >
954
+ <li >
955
+
956
+ ` @elseif.skipBalanced ` whether to skip balanced if-else pairs (default true)
957
+
958
+ </li >
959
+
960
+ </ul >
961
+
941
962
942
963
<a name =" emptyFallthrough-ref " ></a >
943
964
## emptyFallthrough
@@ -1161,7 +1182,15 @@ func f(x *[1024]int) {}
1161
1182
1162
1183
1163
1184
Checker parameters:
1164
- * ` @hugeParam.sizeThreshold ` size in bytes that makes the warning trigger (default 80)
1185
+ <ul >
1186
+ <li >
1187
+
1188
+ ` @hugeParam.sizeThreshold ` size in bytes that makes the warning trigger (default 80)
1189
+
1190
+ </li >
1191
+
1192
+ </ul >
1193
+
1165
1194
1166
1195
<a name =" ifElseChain-ref " ></a >
1167
1196
## ifElseChain
@@ -1345,7 +1374,15 @@ for _, v := range a {
1345
1374
1346
1375
1347
1376
Checker parameters:
1348
- * ` @nestingReduce.bodyWidth ` min number of statements inside a branch to trigger a warning (default 5)
1377
+ <ul >
1378
+ <li >
1379
+
1380
+ ` @nestingReduce.bodyWidth ` min number of statements inside a branch to trigger a warning (default 5)
1381
+
1382
+ </li >
1383
+
1384
+ </ul >
1385
+
1349
1386
1350
1387
<a name =" nilValReturn-ref " ></a >
1351
1388
## nilValReturn
@@ -1381,6 +1418,31 @@ if err != nil {
1381
1418
1382
1419
1383
1420
1421
+ <a name =" octalLiteral-ref " ></a >
1422
+ ## octalLiteral
1423
+
1424
+ [
1425
+ ** diagnostic**
1426
+ ** experimental** ]
1427
+
1428
+ Detects octal literals passed to functions.
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+ ** Before:**
1435
+ ``` go
1436
+ foo (02 )
1437
+ ```
1438
+
1439
+ ** After:**
1440
+ ``` go
1441
+ foo (2 )
1442
+ ```
1443
+
1444
+
1445
+
1384
1446
<a name =" offBy1-ref " ></a >
1385
1447
## offBy1
1386
1448
@@ -1488,8 +1550,20 @@ for _, x := range &xs { // No copy
1488
1550
1489
1551
1490
1552
Checker parameters:
1491
- * ` @rangeExprCopy.sizeThreshold ` size in bytes that makes the warning trigger (default 512)
1492
- * ` @rangeExprCopy.skipTestFuncs ` whether to check test functions (default true)
1553
+ <ul >
1554
+ <li >
1555
+
1556
+ ` @rangeExprCopy.sizeThreshold ` size in bytes that makes the warning trigger (default 512)
1557
+
1558
+ </li >
1559
+ <li >
1560
+
1561
+ ` @rangeExprCopy.skipTestFuncs ` whether to check test functions (default true)
1562
+
1563
+ </li >
1564
+
1565
+ </ul >
1566
+
1493
1567
1494
1568
<a name =" rangeValCopy-ref " ></a >
1495
1569
## rangeValCopy
@@ -1522,8 +1596,20 @@ for i := range xs {
1522
1596
1523
1597
1524
1598
Checker parameters:
1525
- * ` @rangeValCopy.sizeThreshold ` size in bytes that makes the warning trigger (default 128)
1526
- * ` @rangeValCopy.skipTestFuncs ` whether to check test functions (default true)
1599
+ <ul >
1600
+ <li >
1601
+
1602
+ ` @rangeValCopy.sizeThreshold ` size in bytes that makes the warning trigger (default 128)
1603
+
1604
+ </li >
1605
+ <li >
1606
+
1607
+ ` @rangeValCopy.skipTestFuncs ` whether to check test functions (default true)
1608
+
1609
+ </li >
1610
+
1611
+ </ul >
1612
+
1527
1613
1528
1614
<a name =" regexpMust-ref " ></a >
1529
1615
## regexpMust
@@ -1810,7 +1896,15 @@ v := a[5]
1810
1896
1811
1897
1812
1898
Checker parameters:
1813
- * ` @underef.skipRecvDeref ` whether to skip (* x).method() calls where x is a pointer receiver (default true)
1899
+ <ul >
1900
+ <li >
1901
+
1902
+ ` @underef.skipRecvDeref ` whether to skip (* x).method() calls where x is a pointer receiver (default true)
1903
+
1904
+ </li >
1905
+
1906
+ </ul >
1907
+
1814
1908
1815
1909
<a name =" unlabelStmt-ref " ></a >
1816
1910
## unlabelStmt
@@ -1896,7 +1990,15 @@ func f() (x, y float64)
1896
1990
1897
1991
1898
1992
Checker parameters:
1899
- * `@unnamedResult.checkExported` whether to check exported functions (default false)
1993
+ <ul>
1994
+ <li>
1995
+
1996
+ `@unnamedResult.checkExported` whether to check exported functions (default false)
1997
+
1998
+ </li>
1999
+
2000
+ </ul>
2001
+
1900
2002
1901
2003
<a name="unnecessaryBlock-ref"></a>
1902
2004
## unnecessaryBlock
0 commit comments