From 080a8fd615815f87e191a43c184ab94d2d47df7c Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Tue, 18 Feb 2020 11:16:16 -0800 Subject: [PATCH 1/2] common: fix shadowed error in SendEmail() --- common/email.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/email.go b/common/email.go index d8f4fc53..2750d8d6 100644 --- a/common/email.go +++ b/common/email.go @@ -65,12 +65,13 @@ func SendEmail(email, subject, msg string) (err error) { body += "\r\n" + msg var c *smtp.Client + var conn *tls.Conn if Config.SMTPEnableTLS { tlsconfig := &tls.Config{ InsecureSkipVerify: true, ServerName: Config.SMTPServer, } - conn, err := tls.Dial("tcp", Config.SMTPServer+":"+Config.SMTPPort, tlsconfig) + conn, err = tls.Dial("tcp", Config.SMTPServer+":"+Config.SMTPPort, tlsconfig) if err != nil { LogWarning(err) return err From 548a8bb39f0b37b0a65d93722f78fc7e26bb154b Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Tue, 18 Feb 2020 11:21:32 -0800 Subject: [PATCH 2/2] common: fix shadowed error in SQLSearcher.Query() --- common/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/search.go b/common/search.go index e51e10fd..2abd8722 100644 --- a/common/search.go +++ b/common/search.go @@ -105,7 +105,7 @@ func (s *SQLSearcher) Query(q string, zones []int) (ids []int, err error) { acc := qgen.NewAcc() stmt := acc.RawPrepare("SELECT `topics`.`tid` FROM `topics` INNER JOIN `replies` ON `topics`.`tid` = `replies`.`tid` WHERE (MATCH(`topics`.`title`) AGAINST (? IN NATURAL LANGUAGE MODE) OR MATCH(`topics`.`content`) AGAINST (? IN NATURAL LANGUAGE MODE) OR MATCH(`replies`.`content`) AGAINST (? IN NATURAL LANGUAGE MODE)) AND `topics`.`parentID` IN(" + zList + ");") - err := acc.FirstError() + err = acc.FirstError() if err != nil { return nil, err }