From 14054fc7769a78ebed03b1f445d1f927ddf4301a Mon Sep 17 00:00:00 2001 From: Shikong <919411476@qq.com> Date: Sun, 30 Oct 2022 02:47:48 +0800 Subject: [PATCH] =?UTF-8?q?wol=20=E5=B9=BB=E6=95=B0=E6=8D=AE=E5=8C=85?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/wol/wol.go | 4 ++++ services/wol/wol_test.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/wol/wol.go b/services/wol/wol.go index 142cfd5..88c963d 100644 --- a/services/wol/wol.go +++ b/services/wol/wol.go @@ -8,3 +8,7 @@ var Services *Service func InitService() { Services = &Service{} } + +func WakeUp(mac string) { + +} diff --git a/services/wol/wol_test.go b/services/wol/wol_test.go index 6b31a4d..c508933 100644 --- a/services/wol/wol_test.go +++ b/services/wol/wol_test.go @@ -8,7 +8,7 @@ import ( "testing" ) -func TestName(t *testing.T) { +func TestWol(t *testing.T) { udpAddr, err := net.ResolveUDPAddr("udp", "255.255.255.255:9") if err != nil { t.Fatal(err) @@ -52,13 +52,13 @@ func TestName(t *testing.T) { conn, err := net.DialUDP("udp", &net.UDPAddr{IP: ipv4}, udpAddr) defer func() { _ = conn.Close() - t.Logf("wol 幻数据包发送成功, %s %s %s", i.Name, ipv4.String(), mac) }() if err != nil { t.Errorf("wol 幻数据包发送失败 %s", err) } _, _ = conn.Write(wolPackage) + t.Logf("wol 幻数据包发送成功, %s %s %s", i.Name, ipv4.String(), mac) } } }