Skip to content

Commit 9a2ac0d

Browse files
authored
chore: format Go Doc comments (#5308)
1 parent 75eef46 commit 9a2ac0d

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

internal/js/timeout_error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func newTimeoutError(place string, d time.Duration) timeoutError {
2727
return timeoutError{place: place, d: d}
2828
}
2929

30-
// String returns the timeout error in human readable format.
30+
// Error returns the timeout error in human readable format.
3131
func (t timeoutError) Error() string {
3232
return fmt.Sprintf("%s() execution timed out after %.f seconds", t.place, t.d.Seconds())
3333
}

js/common/bridge.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var fieldNameExceptions = map[string]string{
1515
"OCSP": "ocsp",
1616
}
1717

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

54-
// MethodName Returns the JS name for an exported method. The first letter of the method's name is
54+
// MethodName returns the JS name for an exported method. The first letter of the method's name is
5555
// lowercased, otherwise it is unaltered.
5656
func MethodName(_ reflect.Type, m reflect.Method) string {
5757
// A field with a name beginning with an X is a constructor, and just gets the prefix stripped.

lib/netext/httpext/request.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type HTTPRequestCookie struct {
2727
Replace bool
2828
}
2929

30-
// Request represent an http request
30+
// Request represents an HTTP request.
3131
type Request struct {
3232
Method string `json:"method"`
3333
URL string `json:"url"`
@@ -36,7 +36,7 @@ type Request struct {
3636
Cookies map[string][]*HTTPRequestCookie `json:"cookies"`
3737
}
3838

39-
// ParsedHTTPRequest a represantion of a request after it has been parsed from a user script
39+
// ParsedHTTPRequest is a representation of a request after it has been parsed from a user script.
4040
type ParsedHTTPRequest struct {
4141
URL *URL
4242
Body *bytes.Buffer
@@ -53,7 +53,7 @@ type ParsedHTTPRequest struct {
5353
TagsAndMeta metrics.TagsAndMeta
5454
}
5555

56-
// Matches non-compliant io.Closer implementations (e.g. zstd.Decoder)
56+
// ncloser matches non-compliant io.Closer implementations (e.g. zstd.Decoder).
5757
type ncloser interface {
5858
Close()
5959
}
@@ -62,7 +62,7 @@ type readCloser struct {
6262
io.Reader
6363
}
6464

65-
// Close readers with differing Close() implementations
65+
// Close closes readers with differing Close() implementations.
6666
func (r readCloser) Close() error {
6767
var err error
6868
switch v := r.Reader.(type) {
@@ -106,7 +106,7 @@ func updateK6Response(k6Response *Response, finishedReq *finishedRequest) {
106106
}
107107
}
108108

109-
// MakeRequest makes http request for tor the provided ParsedHTTPRequest.
109+
// MakeRequest makes an HTTP request for the provided ParsedHTTPRequest.
110110
//
111111
// TODO: split apart...
112112
//

lib/types/hostnametrie.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (d *NullHostnameTrie) UnmarshalJSON(data []byte) error {
5050
return nil
5151
}
5252

53-
// Source return source hostnames that were used diring the construction
53+
// Source returns source hostnames that were used during construction.
5454
func (d *NullHostnameTrie) Source() []string {
5555
if d.Trie == nil {
5656
return []string{}
@@ -119,8 +119,8 @@ func isValidHostnamePattern(s string) error {
119119
return nil
120120
}
121121

122-
// insert a hostname pattern into the given HostnameTrie. Returns an error
123-
// if hostname pattern is invalid.
122+
// insert inserts a hostname pattern into the HostnameTrie. It returns an error
123+
// if the hostname pattern is invalid.
124124
func (t *HostnameTrie) insert(s string) error {
125125
s = strings.ToLower(s)
126126
if err := isValidHostnamePattern(s); err != nil {

0 commit comments

Comments
 (0)