chore: upgrade dependencies

This commit is contained in:
2022-06-09 12:30:53 +02:00
parent 7203f3d6a1
commit dcb93ec8f7
518 changed files with 27809 additions and 3222 deletions

View File

@@ -50,7 +50,7 @@ func NewEncoder(path, query string, headers http.Header) (*Encoder, error) {
// Due net/http requiring `Content-Length` to be specified on the http.Request#ContentLength directly. Encode
// will look for whether the header is present, and if so will remove it and set the respective value on http.Request.
//
// Returns any error if one occurred during encoding.
// Returns any error occurring during encoding.
func (e *Encoder) Encode(req *http.Request) (*http.Request, error) {
req.URL.Path, req.URL.RawPath = string(e.path), string(e.rawPath)
req.URL.RawQuery = e.query.Encode()
@@ -80,7 +80,7 @@ func (e *Encoder) SetHeader(key string) HeaderValue {
return newHeaderValue(e.header, key, false)
}
// Headers returns a Header used encoding headers with the given prefix
// Headers returns a Header used for encoding headers with the given prefix
func (e *Encoder) Headers(prefix string) Headers {
return Headers{
header: e.header,
@@ -110,7 +110,7 @@ func (e *Encoder) AddQuery(key string) QueryValue {
}
// HasQuery returns if a query with the key specified exists with one or
// more value.
// more values.
func (e *Encoder) HasQuery(key string) bool {
return len(e.query.Get(key)) != 0
}

View File

@@ -20,6 +20,9 @@ func newURIValue(path *[]byte, rawPath *[]byte, buffer *[]byte, key string) URIV
func (u URIValue) modifyURI(value string) (err error) {
*u.path, *u.buffer, err = replacePathElement(*u.path, *u.buffer, u.key, value, false)
if err != nil {
return err
}
*u.rawPath, *u.buffer, err = replacePathElement(*u.rawPath, *u.buffer, u.key, value, true)
return err
}

View File

@@ -4,7 +4,7 @@ import (
"bytes"
)
// Array represent the encoding of a JSON Array
// Array represents the encoding of a JSON Array
type Array struct {
w *bytes.Buffer
writeComma bool

View File

@@ -7,8 +7,8 @@ import (
"io"
)
// DiscardUnknownField discards unknown fields from decoder body.
// This function is useful while deserializing json body with additional
// DiscardUnknownField discards unknown fields from a decoder body.
// This function is useful while deserializing a JSON body with additional
// unknown information that should be discarded.
func DiscardUnknownField(decoder *json.Decoder) error {
// This deliberately does not share logic with CollectUnknownField, even