Fast Link Checker for Markdown and HTML in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
439 B

package main
import (
"strings"
"github.com/fatih/color"
)
type urlResult struct {
url string
err error
}
func (r urlResult) String() string {
if r.err == nil {
return color.GreenString("OK") + "\t" + r.url
}
if r.err == errSkipped {
return color.YellowString("SKIPPED") + "\t" + r.url
}
s := r.err.Error()
return color.RedString("ERROR") + "\t" + r.url + "\n\t" +
color.YellowString(strings.ToUpper(s[:1])+s[1:])
}