Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion internal/js/timeout_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func newTimeoutError(place string, d time.Duration) timeoutError {
return timeoutError{place: place, d: d}
}

// String returns the timeout error in human readable format.
// Error returns the timeout error in human readable format.
func (t timeoutError) Error() string {
return fmt.Sprintf("%s() execution timed out after %.f seconds", t.place, t.d.Seconds())
}
Expand Down
4 changes: 2 additions & 2 deletions js/common/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var fieldNameExceptions = map[string]string{
"OCSP": "ocsp",
}

// FieldName Returns the JS name for an exported struct field. The name is snake_cased, with respect for
// FieldName returns the JS name for an exported struct field. The name is snake_cased, with respect for
// certain common initialisms (URL, ID, HTTP, etc).
func FieldName(_ reflect.Type, f reflect.StructField) string {
// PkgPath is non-empty for unexported fields.
Expand Down Expand Up @@ -51,7 +51,7 @@ var methodNameExceptions = map[string]string{
"OCSP": "ocsp",
}

// MethodName Returns the JS name for an exported method. The first letter of the method's name is
// MethodName returns the JS name for an exported method. The first letter of the method's name is
// lowercased, otherwise it is unaltered.
func MethodName(_ reflect.Type, m reflect.Method) string {
// A field with a name beginning with an X is a constructor, and just gets the prefix stripped.
Expand Down
10 changes: 5 additions & 5 deletions lib/netext/httpext/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type HTTPRequestCookie struct {
Replace bool
}

// Request represent an http request
// Request represents an HTTP request.
type Request struct {
Method string `json:"method"`
URL string `json:"url"`
Expand All @@ -36,7 +36,7 @@ type Request struct {
Cookies map[string][]*HTTPRequestCookie `json:"cookies"`
}

// ParsedHTTPRequest a represantion of a request after it has been parsed from a user script
// ParsedHTTPRequest is a representation of a request after it has been parsed from a user script.
type ParsedHTTPRequest struct {
URL *URL
Body *bytes.Buffer
Expand All @@ -53,7 +53,7 @@ type ParsedHTTPRequest struct {
TagsAndMeta metrics.TagsAndMeta
}

// Matches non-compliant io.Closer implementations (e.g. zstd.Decoder)
// ncloser matches non-compliant io.Closer implementations (e.g. zstd.Decoder).
type ncloser interface {
Close()
}
Expand All @@ -62,7 +62,7 @@ type readCloser struct {
io.Reader
}

// Close readers with differing Close() implementations
// Close closes readers with differing Close() implementations.
func (r readCloser) Close() error {
var err error
switch v := r.Reader.(type) {
Expand Down Expand Up @@ -106,7 +106,7 @@ func updateK6Response(k6Response *Response, finishedReq *finishedRequest) {
}
}

// MakeRequest makes http request for tor the provided ParsedHTTPRequest.
// MakeRequest makes an HTTP request for the provided ParsedHTTPRequest.
//
// TODO: split apart...
//
Expand Down
6 changes: 3 additions & 3 deletions lib/types/hostnametrie.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (d *NullHostnameTrie) UnmarshalJSON(data []byte) error {
return nil
}

// Source return source hostnames that were used diring the construction
// Source returns source hostnames that were used during construction.
func (d *NullHostnameTrie) Source() []string {
if d.Trie == nil {
return []string{}
Expand Down Expand Up @@ -119,8 +119,8 @@ func isValidHostnamePattern(s string) error {
return nil
}

// insert a hostname pattern into the given HostnameTrie. Returns an error
// if hostname pattern is invalid.
// insert inserts a hostname pattern into the HostnameTrie. It returns an error
// if the hostname pattern is invalid.
func (t *HostnameTrie) insert(s string) error {
s = strings.ToLower(s)
if err := isValidHostnamePattern(s); err != nil {
Expand Down
Loading