diff --git a/attachment/attachment.go b/attachment/attachment.go index 0d1344d..cd3bd6b 100644 --- a/attachment/attachment.go +++ b/attachment/attachment.go @@ -201,7 +201,9 @@ func prepareAttachment(opener vfs.Opener, base, name string) (Attachment, error) if err != nil { return Attachment{}, karma.Format(err, "unable to open file: %q", attachmentPath) } - defer file.Close() + defer func() { + _ = file.Close() + }() fileBytes, err := io.ReadAll(file) if err != nil { diff --git a/confluence/api.go b/confluence/api.go index 8eda159..3b1369b 100644 --- a/confluence/api.go +++ b/confluence/api.go @@ -260,7 +260,7 @@ func (api *API) CreateAttachment( if len(result.Results) == 0 { return info, errors.New( - "Confluence REST API for creating attachments returned " + + "the Confluence REST API for creating attachments returned " + "0 json objects, expected at least 1", ) } @@ -794,21 +794,23 @@ func (api *API) RestrictPageUpdates( func newErrorStatusNotOK(request *gopencils.Resource) error { if request.Raw.StatusCode == http.StatusUnauthorized { return errors.New( - "Confluence API returned unexpected status: 401 (Unauthorized)", + "the Confluence API returned unexpected status: 401 (Unauthorized)", ) } if request.Raw.StatusCode == http.StatusNotFound { return errors.New( - "Confluence API returned unexpected status: 404 (Not Found)", + "the Confluence API returned unexpected status: 404 (Not Found)", ) } output, _ := io.ReadAll(request.Raw.Body) - defer request.Raw.Body.Close() + defer func() { + _ = request.Raw.Body.Close() + }() return fmt.Errorf( - "Confluence API returned unexpected status: %v, "+ + "the Confluence API returned unexpected status: %v, "+ "output: %q", request.Raw.Status, output, ) diff --git a/renderer/text.go b/renderer/text.go index d75e96c..a8c6576 100644 --- a/renderer/text.go +++ b/renderer/text.go @@ -72,7 +72,7 @@ func (r *ConfluenceTextRenderer) renderText(w util.BufWriter, source []byte, nod case html.EastAsianLineBreaksNone: writeLineBreak = false case html.EastAsianLineBreaksSimple: - writeLineBreak = !(util.IsEastAsianWideRune(thisLastRune) && util.IsEastAsianWideRune(siblingFirstRune)) + writeLineBreak = !util.IsEastAsianWideRune(thisLastRune) || !util.IsEastAsianWideRune(siblingFirstRune) case html.EastAsianLineBreaksCSS3Draft: writeLineBreak = eastAsianLineBreaksCSS3DraftSoftLineBreak(thisLastRune, siblingFirstRune) } diff --git a/util/cli.go b/util/cli.go index bd9c9d0..2eb61b9 100644 --- a/util/cli.go +++ b/util/cli.go @@ -325,7 +325,7 @@ func processFile( } var finalVersionMessage string - var shouldUpdatePage bool = true + var shouldUpdatePage = true if cCtx.Bool("changes-only") { contentHash := getSHA1Hash(html)