@@ -145,45 +145,45 @@ func NewConfig() *Config {
145145 return & Config {}
146146}
147147
148- func (c * Config ) Validate () []error {
148+ func (config * Config ) Validate () []error {
149149 var errs []error
150- if utils .IsNilOrZero (c .URL ) {
150+ if utils .IsNilOrZero (config .URL ) {
151151 errs = append (errs , errors .New ("request URL is required" ))
152152 } else {
153- if c .URL .Scheme == "" {
154- c .URL .Scheme = "http"
153+ if config .URL .Scheme == "" {
154+ config .URL .Scheme = "http"
155155 }
156- if c .URL .Scheme != "http" && c .URL .Scheme != "https" {
156+ if config .URL .Scheme != "http" && config .URL .Scheme != "https" {
157157 errs = append (errs , errors .New ("request URL scheme must be http or https" ))
158158 }
159159
160160 urlParams := types.Params {}
161- for key , values := range c .URL .Query () {
161+ for key , values := range config .URL .Query () {
162162 for _ , value := range values {
163163 urlParams = append (urlParams , types.KeyValue [string , []string ]{
164164 Key : key ,
165165 Value : []string {value },
166166 })
167167 }
168168 }
169- c .Params = append (urlParams , c .Params ... )
170- c .URL .RawQuery = ""
169+ config .Params = append (urlParams , config .Params ... )
170+ config .URL .RawQuery = ""
171171 }
172172
173- if utils .IsNilOrZero (c .Method ) {
173+ if utils .IsNilOrZero (config .Method ) {
174174 errs = append (errs , errors .New ("request method is required" ))
175175 }
176- if utils .IsNilOrZero (c .Timeout ) {
176+ if utils .IsNilOrZero (config .Timeout ) {
177177 errs = append (errs , errors .New ("request timeout must be greater than 0" ))
178178 }
179- if utils .IsNilOrZero (c .DodosCount ) {
179+ if utils .IsNilOrZero (config .DodosCount ) {
180180 errs = append (errs , errors .New ("dodos count must be greater than 0" ))
181181 }
182- if utils .IsNilOrZero (c .Duration ) && utils .IsNilOrZero (c .RequestCount ) {
182+ if utils .IsNilOrZero (config .Duration ) && utils .IsNilOrZero (config .RequestCount ) {
183183 errs = append (errs , errors .New ("you should provide at least one of duration or request count" ))
184184 }
185185
186- for i , proxy := range c .Proxies {
186+ for i , proxy := range config .Proxies {
187187 if proxy .String () == "" {
188188 errs = append (errs , fmt .Errorf ("proxies[%d]: proxy cannot be empty" , i ))
189189 } else if schema := proxy .Scheme ; ! slices .Contains (SupportedProxySchemes , schema ) {
0 commit comments