mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -08:00
parent
bffde60751
commit
a0dffad62d
|
@ -5,10 +5,10 @@ import (
|
|||
"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
|
||||
func IsConnected() bool {
|
||||
timeout := 200 * time.Millisecond
|
||||
_, err := net.DialTimeout("tcp", "google.com:80", timeout)
|
||||
_, err := net.DialTimeout("tcp", "ohmyposh.dev:80", timeout)
|
||||
return err == nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue