File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 8
8
cd $i
9
9
go fmt
10
10
go mod tidy
11
+ # go install golang.org/x/tools/cmd/goimports@latest
11
12
goimports -w .
12
13
cd $current_dir
13
14
done
@@ -21,30 +22,37 @@ echo "====Health & Standards===="
21
22
go vet $( go list -m)
22
23
23
24
# Stricter linting
25
+ # go install honnef.co/go/tools/cmd/staticcheck@latest
24
26
staticcheck $( go list -m)
25
27
26
28
# Run Even stricter linting
29
+ # go install -v github.com/go-critic/go-critic/cmd/gocritic@latest
27
30
gocritic check $( go list -m)
28
31
29
32
echo " ====Error handling===="
30
33
# Identifies any non-exhaustive case statements
34
+ # go install github.com/nishanths/exhaustive/cmd/exhaustive@latest
31
35
exhaustive $( go list -m)
32
36
33
37
# Check for potential Nil panics
34
38
# nilaway $(go list -m)
35
39
36
40
echo " ====Performance===="
37
41
# Identifies areas where pre-allocating slices could improve performance
42
+ # go install github.com/alexkohler/prealloc@latest
38
43
prealloc $( go list -m)
39
44
40
45
echo " ====Maintainability===="
41
46
# Detects frequently used strings which could be constants
47
+ # go get github.com/jgautheron/goconst/cmd/goconst
42
48
goconst -min-occurrences 5 ./...
43
49
44
50
# Identifies mixed pointer receivers to an interface
51
+ # go install github.com/nikolaydubina/smrcptr@latest
45
52
smrcptr $( go list -m)
46
53
47
54
echo " ====Complexity===="
48
55
# Limit Cognitive complexity
56
+ # go install github.com/jgautheron/goconst/cmd/goconst@latest
49
57
gocognit -over 15 -top 10 $( go list -m -f ' {{.Dir}}' )
50
58
You can’t perform that action at this time.
0 commit comments