mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-27 20:09:39 -08:00
parent
bffde60751
commit
a0dffad62d
|
@ -5,10 +5,10 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// if we can connect to google within 200ms, we are connected
|
// if we can connect to ohmyposh within 200ms, we are connected
|
||||||
// otherwise, let's consider being offline
|
// otherwise, let's consider being offline
|
||||||
func IsConnected() bool {
|
func IsConnected() bool {
|
||||||
timeout := 200 * time.Millisecond
|
timeout := 200 * time.Millisecond
|
||||||
_, err := net.DialTimeout("tcp", "google.com:80", timeout)
|
_, err := net.DialTimeout("tcp", "ohmyposh.dev:80", timeout)
|
||||||
return err == nil
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue