~migadu/alps-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] plugins/base/routes: fix err variable shadowing

Silvan Jegen <s.jegen@gmail.com>
Details
Message ID
<20241220221123.20346-1-s.jegen@gmail.com>
DKIM signature
pass
Download raw message
Patch: +4 -4
Redeclaring the same variable shadows the outer one. This means the
error check below will never check this error.

This issue was found with golangci-lint.

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
---
 plugins/base/routes.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index 10b30c1..623a5cc 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -857,8 +857,8 @@ func populateMessageFromOriginalMessage(ctx *alps.Context, inReplyToPath message

		ret.Text, err = quote(strings.NewReader(text))
	default:
		err := fmt.Errorf("cannot forward %q part", mimeType)
		err = echo.NewHTTPError(http.StatusBadRequest, err)
		defErr := fmt.Errorf("cannot forward %q part", mimeType)
		err = echo.NewHTTPError(http.StatusBadRequest, defErr)
	}
	if err != nil {
		return ret, err
@@ -944,8 +944,8 @@ func handleForward(ctx *alps.Context) error {

			msg.Text, err = quote(strings.NewReader(text))
		default:
			err := fmt.Errorf("cannot forward %q part", mimeType)
			err = echo.NewHTTPError(http.StatusBadRequest, err)
			defErr := fmt.Errorf("cannot forward %q part", mimeType)
			err = echo.NewHTTPError(http.StatusBadRequest, defErr)
		}
		if err != nil {
			return err
-- 
2.47.1
Details
Message ID
<PXsUeUqTM32Wcr68nNwyJG9clUWbimp7MpZRQp8QFC1pUKfQq_c37f_Z95Ch4YZhQ5Mw2YlFeyGaWh3U_31hLmevpRsOVBHWAw8iVhpQ82U=@emersion.fr>
In-Reply-To
<20241220221123.20346-1-s.jegen@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Good catch! Pushed, thanks!
Reply to thread Export thread (mbox)