docs(godoc): fix a bunch of typos

This commit is contained in:
Julien Neuhart
2025-04-17 11:15:52 +02:00
parent 9701f88ae3
commit 3cbf772acf
34 changed files with 123 additions and 122 deletions

View File

@@ -26,14 +26,14 @@ type client struct {
}
// send call the webhook either to send the success response or the error response.
func (c client) send(body io.Reader, headers map[string]string, erroed bool) error {
func (c client) send(body io.Reader, headers map[string]string, errored bool) error {
url := c.url
if erroed {
if errored {
url = c.errorUrl
}
method := c.method
if erroed {
if errored {
method = c.errorMethod
}
@@ -54,9 +54,9 @@ func (c client) send(body io.Reader, headers map[string]string, erroed bool) err
contentLength, ok := headers[echo.HeaderContentLength]
if ok {
// Golang "http" package should automatically calculate the size of the
// body. But, when using a buffered file reader, it does not work.
// Worse, the "Content-Length" header is also removed. Therefore, in
// order to keep this valuable information, we have to trust the caller
// body. But when using a buffered file reader, it does not work.
// Worse, the "Content-Length" header is also removed. Therefore,
// to keep this valuable information, we have to trust the caller
// by reading the value of the "Content-Length" entry and set it as the
// content length of the request. It's kinda suboptimal, but hey, at
// least it works.
@@ -100,7 +100,7 @@ func (c client) send(body io.Reader, headers map[string]string, erroed bool) err
fields[3] = zap.String("latency_human", finishTime.Sub(c.startTime).String())
fields[4] = zap.Int64("bytes_out", req.ContentLength)
if erroed {
if errored {
c.logger.Warn("request to webhook with error details handled", fields...)
return nil

View File

@@ -113,7 +113,7 @@ func webhookMiddleware(w *Webhook) api.Middleware {
}
}
// Retrieve values from echo.Context before it get recycled.
// Retrieve values from echo.Context before it gets recycled.
// See https://github.com/gotenberg/gotenberg/issues/1000.
startTime := c.Get("startTime").(time.Time)
traceHeader := c.Get("traceHeader").(string)
@@ -189,7 +189,7 @@ func webhookMiddleware(w *Webhook) api.Middleware {
return
}
// No error, let's get build the output file.
// No error, let's get to build the output file.
outputPath, err := ctx.BuildOutputFile()
if err != nil {
ctx.Log().Error(fmt.Sprintf("build output file: %s", err))

View File

@@ -14,7 +14,7 @@ func init() {
gotenberg.MustRegisterModule(new(Webhook))
}
// Webhook is a module which provides a middleware for uploading output files
// Webhook is a module that provides a middleware for uploading output files
// to any destinations in an asynchronous fashion.
type Webhook struct {
allowList *regexp2.Regexp