File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ package filters
18
18
19
19
import (
20
20
"fmt"
21
- "strconv"
22
21
"strings"
23
22
24
23
"github.com/haproxytech/config-parser/v4/common"
@@ -77,36 +76,18 @@ func (b *BandwidthLimit) parsePart(parts []string, index int) error {
77
76
part := parts [index ]
78
77
switch part {
79
78
case "default-limit" :
80
- if _ , err := strconv .ParseInt (parts [index + 1 ], 10 , 64 ); err != nil {
81
- return fmt .Errorf ("%s expects a value in milliseconds: %w" , part , err )
82
- }
83
-
84
79
b .DefaultLimit = parts [index + 1 ]
85
80
case "limit" :
86
- if _ , err := strconv .ParseInt (parts [index + 1 ], 10 , 64 ); err != nil {
87
- return fmt .Errorf ("%s expects a value in milliseconds: %w" , part , err )
88
- }
89
-
90
81
b .Limit = parts [index + 1 ]
91
82
case "key" :
92
83
b .Key = parts [index + 1 ]
93
84
case "default-period" :
94
- if _ , err := strconv .ParseInt (parts [index + 1 ], 10 , 64 ); err != nil {
95
- return fmt .Errorf ("%s expects a value in milliseconds: %w" , part , err )
96
- }
97
-
98
85
b .DefaultPeriod = parts [index + 1 ]
99
86
case "min-size" :
100
- if _ , err := strconv .ParseInt (parts [index + 1 ], 10 , 64 ); err != nil {
101
- return fmt .Errorf ("min-size expects a value in milliseconds: %w" , err )
102
- }
103
-
104
87
v := parts [index + 1 ]
105
-
106
88
b .MinSize = & v
107
89
case "table" :
108
90
v := parts [index + 1 ]
109
-
110
91
b .Table = & v
111
92
default :
112
93
return fmt .Errorf ("unsupported option: %s" , part )
You can’t perform that action at this time.
0 commit comments