Documentation ¶ Index ¶ Variables func GetFree(ip ...string) (port int, err error) Constants ¶ This section is empty. Variables ¶ View Source var ( ErrGetTCP = errors.New("get tcp address") ErrNotIP = errors.New("provided value isn't a valid ip") ) Functions ¶ func GetFree ¶ func GetFree(ip ...string) (port int, err error) GetFree return an available free port to listen on. It use the synthax 'localhost:0' under the hood to attempt to listen on a random port. The list ip, which default to localhost, can be parametrized. Types ¶ This section is empty. Source Files ¶ View all Source files get.go Click to show internal directories. Click to hide internal directories.