Skip to content

Commit 1a7fee5

Browse files
committed
docs: add description
1 parent bb07bb8 commit 1a7fee5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# gencon [![Go Reference](https://pkg.go.dev/badge/github.com/ari1021/gencon.svg)](https://pkg.go.dev/github.com/ari1021/gencon)
22

3+
`gencon` is an analyzer which reports unnecessary type constraints `any`.
4+
35
`gencon` consists of two command, `gencon` and `fixgencon`.
46

57
- `gencon`
@@ -27,6 +29,13 @@ func invoke() { // OK
2729
}
2830
```
2931

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+
3039
### install
3140

3241
```sh
@@ -43,6 +52,7 @@ $ go vet -vettool=`which gencon` pkgname
4352

4453
`fixgencon` is under development and supports only single type parameter.
4554

55+
4656
```go
4757
--- before `fixgencon` ---
4858

@@ -81,6 +91,8 @@ func invoke() { // OK
8191
}
8292
```
8393

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+
8496
### install
8597

8698
```sh

0 commit comments

Comments
 (0)