A Go library for allocate ports, dynamically.
import (
...
port "github.com/1eedaegon/go-dynamic-port-allocator"
...
)
ports := port.Get(3)
// ports is something like []int{10000, 10001, 10002}
Or
import (
...
port "github.com/1eedaegon/go-dynamic-port-allocator"
...
)
ports := port.GetS(3)
// ports is something like []string{"10000", "10001", "10002"}