diff --git a/main.go b/main.go index 55ab0ec5..dfe01a62 100644 --- a/main.go +++ b/main.go @@ -77,11 +77,12 @@ func sourceFromArg(arg string) (*source, error) { // a GitHub or GitLab URL (even without the protocol): var dnsErr *net.DNSError + var opErr *net.OpError src, err := readmeURL(arg) if src != nil && err == nil { // if there's an error, try next methods... return src, nil - } else if err != nil && errors.As(err, &dnsErr) { + } else if err != nil && errors.As(err, &dnsErr) || errors.As(err, &opErr) { // fail if there's a network error. return src, err }