Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/validate-args-length #2823 #3974

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(http.go): fixed method name in comment
  • Loading branch information
ArjitGopher authored Oct 2, 2024
commit f9bbc5c9e3263ca9b5de6721aef8a66989247132
4 changes: 2 additions & 2 deletions js/modules/k6/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}
}


Check failure on line 63 in js/modules/k6/http/http.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)
validateArgCount := func(methodName string,args ...sobek.Value){
if len(args)>2 {
vu.State().Logger.Warningf("%s method has more than two arguments",methodName)
Expand All @@ -79,7 +79,7 @@
// http.get(url, params) doesn't have a body argument, so we add undefined
// as the third argument to http.request(method, url, body, params)

// http.get method should not have more than two arguments
// get method should not have more than two arguments
validateArgCount("get",args...)
args = append([]sobek.Value{sobek.Undefined()}, args...)
return mi.defaultClient.Request(http.MethodGet, url, args...)
Expand All @@ -88,7 +88,7 @@
// http.head(url, params) doesn't have a body argument, so we add undefined
// as the third argument to http.request(method, url, body, params)

// http.head method should not have more than two arguments
// head method should not have more than two arguments
validateArgCount("head",args...)
args = append([]sobek.Value{sobek.Undefined()}, args...)
return mi.defaultClient.Request(http.MethodHead, url, args...)
Expand Down
Loading