mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-11 08:12:26 +08:00
doc: add document and example for IsPingConnected and IsTelnetConnected
This commit is contained in:
@@ -178,3 +178,27 @@ func ExampleConvertMapToQueryString() {
|
||||
// Output:
|
||||
// a=1&b=2&c=3
|
||||
}
|
||||
|
||||
func ExampleIsPingConnected() {
|
||||
result1 := IsPingConnected("www.baidu.com")
|
||||
result2 := IsPingConnected("www.!@#&&&.com")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
|
||||
// Output:
|
||||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
func ExampleIsTelnetConnected() {
|
||||
result1 := IsTelnetConnected("www.baidu.com", "80")
|
||||
result2 := IsTelnetConnected("www.baidu.com", "123")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
|
||||
// Output:
|
||||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user