diff --git a/examples/markdown.feature b/examples/markdown.feature index d21a727..46afc95 100644 --- a/examples/markdown.feature +++ b/examples/markdown.feature @@ -40,4 +40,4 @@ Feature: Markdown """ When I run `linkcheck foo.md` Then the exit status should be 1 - And the stderr should contain "ERROR: " + And the stderr should contain "ERROR" diff --git a/main.go b/main.go index 5986041..aeb3d49 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "github.com/a8m/mark" "github.com/docopt/docopt-go" + "github.com/fatih/color" "golang.org/x/net/html" ) @@ -38,8 +39,10 @@ func main() { ok := true for s := range extractURLs(n) { + colored := color.New(color.FgCyan).SprintFunc()(s) + if _, err := http.Get(s); err != nil { - printToStderr("ERROR: " + err.Error()) + printToStderr(color.New(color.FgRed).SprintFunc()("ERROR") + "\t" + colored + "\t" + err.Error()) ok = false } }