You've already forked CasaOS
mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-07-06 23:37:26 +02:00
19 lines
358 B
Go
19 lines
358 B
Go
![]() |
package port
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestPortAvailable(t *testing.T) {
|
||
|
// fmt.Println(PortAvailable())
|
||
|
//fmt.Println(IsPortAvailable(6881,"tcp"))
|
||
|
p, _ := GetAvailablePort("udp")
|
||
|
fmt.Println("udp", p)
|
||
|
fmt.Println(IsPortAvailable(p, "udp"))
|
||
|
|
||
|
t1, _ := GetAvailablePort("tcp")
|
||
|
fmt.Println("tcp", t1)
|
||
|
fmt.Println(IsPortAvailable(t1, "tcp"))
|
||
|
}
|