File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
# gencon [ ![ Go Reference] ( https://pkg.go.dev/badge/github.com/ari1021/gencon.svg )] ( https://pkg.go.dev/github.com/ari1021/gencon )
2
2
3
+ ` gencon ` is an analyzer which reports unnecessary type constraints ` any ` .
4
+
3
5
` gencon ` consists of two command, ` gencon ` and ` fixgencon ` .
4
6
5
7
- ` gencon `
@@ -27,6 +29,13 @@ func invoke() { // OK
27
29
}
28
30
```
29
31
32
+ ` gencon ` reports the function only with ` any ` constraint, not other constraints such as ` comparable ` or ` constraints.Ordered ` .
33
+
34
+ If the function isn't called from anywhere, ` gencon ` reports without hint.
35
+
36
+ We can see example of ` gencon ` command report [ here] ( https://github.com/ari1021/gencon/blob/main/testdata/src/a/a.go ) .
37
+
38
+
30
39
### install
31
40
32
41
``` sh
@@ -43,6 +52,7 @@ $ go vet -vettool=`which gencon` pkgname
43
52
44
53
` fixgencon ` is under development and supports only single type parameter.
45
54
55
+
46
56
``` go
47
57
--- before ` fixgencon` ---
48
58
@@ -81,6 +91,8 @@ func invoke() { // OK
81
91
}
82
92
```
83
93
94
+ ` fixgencon ` doesn't fix ` any ` when the function isn't called from anywhere, because ` fixgencon ` doesn't know what to change from ` any ` .
95
+
84
96
### install
85
97
86
98
``` sh
You can’t perform that action at this time.
0 commit comments