//go:build darwin package netdetect import "os/exec" // DefaultRoutes returns the host's IPv4 default routes, read from the macOS // routing table. func DefaultRoutes() ([]Route, error) { out, err := exec.Command("netstat", "-rn", "-f", "inet").Output() if err != nil { return nil, err } return parseNetstat(string(out)), nil }