From 2cf8d40c80c6210ef4b53119f5a003c0086bea74 Mon Sep 17 00:00:00 2001 From: coward Date: Fri, 5 Jan 2024 17:11:47 +0800 Subject: [PATCH] =?UTF-8?q?:art:=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index d8d2ad8..9bacce6 100644 --- a/client.go +++ b/client.go @@ -31,11 +31,11 @@ func NewWxHelper(host string, port uint) WxHelper { // @param uri // @return string func (w *WxHelper) GetAddr(uri string) string { - if !strings.HasPrefix(w.Host, "http") && !strings.HasPrefix(w.Host, "https://") { - w.Host = fmt.Sprintf("http://%s", w.Host) + if !strings.HasPrefix(w.host, "http") && !strings.HasPrefix(w.host, "https://") { + w.host = fmt.Sprintf("http://%s", w.host) } - return fmt.Sprintf("%s:%d%s", w.Host, w.Port, uri) + return fmt.Sprintf("%s:%d%s", w.host, w.port, uri) } // SetHook