mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 20:28:17 +08:00
28 lines
534 B
Go
28 lines
534 B
Go
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
// If a copy of the MIT was not distributed with this file,
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
package gtcp_test
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/v2/net/gtcp"
|
|
)
|
|
|
|
func ExampleGetFreePort() {
|
|
fmt.Println(gtcp.GetFreePort())
|
|
|
|
// May Output:
|
|
// 57429 <nil>
|
|
}
|
|
|
|
func ExampleGetFreePorts() {
|
|
fmt.Println(gtcp.GetFreePorts(2))
|
|
|
|
// May Output:
|
|
// [57743 57744] <nil>
|
|
}
|