This isn't really something that can be solved, in Go or otherwise. The
operating system only knows that a given interface is connected to a
network, it doesn't know whether that network is routes to the internet.

Any piece of software that actually checks of you are "connected to the
internet" does some variant of what you described as "connecting to
google.com". If you want to check that you are connected to the internet,
you'll have to do the same.

On Mon, Dec 5, 2022, 13:49 Nikhilesh Susarla <nikhilesh1...@gmail.com>
wrote:

> Hi,
>
> I want to check if my system is connected to internet or not.
> 1. Say I may be connected to wifi but there is no internet.
> 2. Connected in lan but there is no internet
>
> So, I want a low level package to get the status of the network card or
> related in Go. Rather than just querying google.com
>
>
> Is there any open source package or C supported package where Go has a
> wrapper.
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/3f0df694-37c8-4e1f-9a0e-ba39969927a4n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/3f0df694-37c8-4e1f-9a0e-ba39969927a4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfGGpAS-vaTbqPhhaJou6hWpUv65ohVizefN%3DhRBu2wVXA%40mail.gmail.com.

Reply via email to