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) } } }