@@ -140,6 +140,7 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
140140 }
141141 }
142142 require .NotEmpty (t , iface )
143+ const goosDarwin = "darwin"
143144
144145 type args struct {
145146 ctx context.Context
@@ -151,6 +152,7 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
151152 name string
152153 args args
153154 wantErr bool
155+ skip func () bool
154156 }{
155157 {
156158 name : "valid all interfaces" ,
@@ -160,6 +162,9 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
160162 buffer : payload ,
161163 opts : []MulticastOption {WithAllMulticastInterface ()},
162164 },
165+ skip : func () bool {
166+ return runtime .GOOS == goosDarwin
167+ },
163168 },
164169 {
165170 name : "valid any interface" ,
@@ -169,6 +174,9 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
169174 buffer : payload ,
170175 opts : []MulticastOption {WithAnyMulticastInterface ()},
171176 },
177+ skip : func () bool {
178+ return runtime .GOOS == goosDarwin
179+ },
172180 },
173181 {
174182 name : "valid first interface" ,
@@ -242,6 +250,10 @@ func TestUDPConnwriteMulticastWithContext(t *testing.T) {
242250
243251 for _ , tt := range tests {
244252 t .Run (tt .name , func (t * testing.T ) {
253+ if tt .skip != nil && tt .skip () {
254+ t .Log ("skipped" )
255+ return
256+ }
245257 err = c1 .WriteMulticast (tt .args .ctx , tt .args .udpAddr , tt .args .buffer , tt .args .opts ... )
246258 c1 .LocalAddr ()
247259 c1 .RemoteAddr ()
@@ -361,6 +373,7 @@ func TestUDPConnWriteToAddr(t *testing.T) {
361373 name string
362374 args args
363375 wantErr bool
376+ skip func () bool
364377 }{
365378 {
366379 name : "IPv4" ,
@@ -407,6 +420,9 @@ func TestUDPConnWriteToAddr(t *testing.T) {
407420 raddr : & net.UDPAddr {IP : net .IPv4 (224 , 0 , 0 , 1 ), Port : 1234 },
408421 buffer : []byte ("hello world" ),
409422 },
423+ skip : func () bool {
424+ return runtime .GOOS == "darwin"
425+ },
410426 },
411427 {
412428 name : "with interface and source" ,
@@ -421,6 +437,10 @@ func TestUDPConnWriteToAddr(t *testing.T) {
421437
422438 for _ , tt := range tests {
423439 t .Run (tt .name , func (t * testing.T ) {
440+ if tt .skip != nil && tt .skip () {
441+ t .Log ("skipped" )
442+ return
443+ }
424444 network := udp4Network
425445 ip := getIfaceAddr (t , iface , true )
426446 if IsIPv6 (tt .args .src ) {
0 commit comments