File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
linters-settings :
2
- govet :
3
- check-shadowing : true
4
2
gocyclo :
5
3
min-complexity : 15
6
4
maligned :
@@ -16,6 +14,10 @@ linters-settings:
16
14
line-length : 140
17
15
goimports :
18
16
local-prefixes : github.com/go-faster/
17
+ revive :
18
+ rules :
19
+ - disabled : true
20
+ name : unused-parameter
19
21
gocritic :
20
22
enabled-tags :
21
23
- diagnostic
@@ -101,3 +103,7 @@ issues:
101
103
# Ignore linters in main packages.
102
104
- path : main\.go
103
105
linters : [goconst, funlen, gocognit, gocyclo]
106
+
107
+ # Too much false-positives.
108
+ - linters : [gosec]
109
+ text : G115
Original file line number Diff line number Diff line change @@ -120,16 +120,16 @@ func (d *Decoder) read() error {
120
120
return nil
121
121
}
122
122
123
- func (d * Decoder ) readAtLeast (min int ) error {
123
+ func (d * Decoder ) readAtLeast (n int ) error {
124
124
if d .reader == nil {
125
125
d .head = d .tail
126
126
return io .ErrUnexpectedEOF
127
127
}
128
128
129
- if need := min - len (d .buf ); need > 0 {
129
+ if need := n - len (d .buf ); need > 0 {
130
130
d .buf = append (d .buf , make ([]byte , need )... )
131
131
}
132
- n , err := io .ReadAtLeast (d .reader , d .buf , min )
132
+ n , err := io .ReadAtLeast (d .reader , d .buf , n )
133
133
if err != nil {
134
134
if err == io .EOF && n == 0 {
135
135
return io .ErrUnexpectedEOF
Original file line number Diff line number Diff line change @@ -135,15 +135,15 @@ func (n Num) Format(f fmt.State, verb rune) {
135
135
case 'd' :
136
136
d , err := n .Int64 ()
137
137
if err != nil {
138
- fmt .Fprintf (f , "%%!invalid(Num=%s)" , n .String ())
138
+ _ , _ = fmt .Fprintf (f , "%%!invalid(Num=%s)" , n .String ())
139
139
return
140
140
}
141
141
v := big .NewInt (d )
142
142
v .Format (f , verb )
143
143
case 'f' :
144
144
d , err := n .Float64 ()
145
145
if err != nil {
146
- fmt .Fprintf (f , "%%!invalid(Num=%s)" , n .String ())
146
+ _ , _ = fmt .Fprintf (f , "%%!invalid(Num=%s)" , n .String ())
147
147
return
148
148
}
149
149
v := big .NewFloat (d )
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ type IntType struct {
23
23
DecoderIterations int // ceil(log10 (max value))
24
24
}
25
25
26
- func defineIntType (name string , max uint64 ) IntType {
27
- formattedLen := len (strconv .FormatUint (max , 10 ))
26
+ func defineIntType (name string , maxN uint64 ) IntType {
27
+ formattedLen := len (strconv .FormatUint (maxN , 10 ))
28
28
decoderIters := formattedLen
29
29
30
30
const decoderItersLimit = 10 - 1
You can’t perform that action at this time.
0 commit comments