Skip to content

Commit

Permalink
wip: ci should fail??
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Dec 5, 2024
1 parent 53d7457 commit 8406b99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions glow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ func TestGlowSources(t *testing.T) {
if errors.As(err, &urlErr) {
t.Logf("Error during execution (args: %s):\n%v", v, err)
t.Skip("Test uses network. Are you connected to the Internet?")
} else {
t.Errorf("Error during execution (args: %s): %T %v", v, err, err)
}
t.Errorf("Error during execution (args: %s): %T %v", v, err, err)

if buf.Len() == 0 {
t.Errorf("Output buffer should not be empty (args: %s)", v)
Expand Down
19 changes: 9 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"io"
"io/fs"
"net"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -76,19 +75,19 @@ 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 err != nil {
return src, err
}
if src != nil && err == nil {
// if there's an error, try next methods...
return src, nil
} else if err != nil && errors.As(err, &dnsErr) || errors.As(err, &opErr) {
// fail if there's a network error.
return src, err
}

// var dnsErr *net.DNSError
// if src != nil && err == nil {
// // if there's an error, try next methods...
// return src, nil
// } else if errors.As(err, &dnsErr) {
// // fail if there's a network error.
// return src, err
// }

// HTTP(S) URLs:
if u, err := url.ParseRequestURI(arg); err == nil && strings.Contains(arg, "://") {
Expand Down

0 comments on commit 8406b99

Please sign in to comment.