From 4448eba28a568bbc1f3d29fca70b0099b3e6edae Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 01 Apr 2025 22:52:38 +0800 Subject: [PATCH] LMTP: Fix error scoping --- lmtp_server.go | 5 +++-- diff --git a/lmtp_server.go b/lmtp_server.go index f16149d7cc37ddbf0aa61d230225707a439c5661..889ed31fa33dcdbb1abef853034dd6f79571eac4 100644 --- a/lmtp_server.go +++ b/lmtp_server.go @@ -127,7 +127,8 @@ if !strings.HasSuffix(to, "@"+config.LMTP.Domain) { continue } localPart := to[:len(to)-len("@"+config.LMTP.Domain)] - segments, err := pathToSegments(localPart) + var segments []string + segments, err = pathToSegments(localPart) if err != nil { // TODO: Should the entire email fail or should we just // notify them out of band? @@ -159,7 +160,7 @@ if err != nil { goto end } default: - err = fmt.Errorf("Emailing any endpoint other than repositories, is not supported yet.") // TODO + err = errors.New("Emailing any endpoint other than repositories, is not supported yet.") // TODO goto end } } -- 2.48.1