Android support for getting network addresses and interfaces (#1056)

* Replace unsupported network functions for android

* Refactor default/android net addresses processing

* Add default connection values, Refactor netenv

* Fix compilation error

* Combine network change default/android functions
This commit is contained in:
Vladimir Stoilov
2023-01-23 16:33:02 +01:00
committed by GitHub
parent bd0314ee9e
commit 6972059321
5 changed files with 106 additions and 4 deletions

15
netenv/os_default.go Normal file
View File

@@ -0,0 +1,15 @@
//go:build !android
package netenv
import (
"net"
)
func osGetInterfaceAddrs() ([]net.Addr, error) {
return net.InterfaceAddrs()
}
func osGetNetworkInterfaces() ([]net.Interface, error) {
return net.Interfaces()
}