refactor: Remove unused import and clean up whitespace
This commit is contained in:
parent
e51702fb74
commit
3a7a21f97e
9
main.go
9
main.go
|
@ -4,7 +4,6 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -33,7 +32,7 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
domain := strings.TrimPrefix(parsedURL.Hostname(), "www.")
|
||||
|
||||
|
||||
// Create results file with domain and timestamp
|
||||
filename := fmt.Sprintf("%s-%s.txt", domain, startTime.Format("2006-01-02-150405"))
|
||||
f, err := os.Create(filename)
|
||||
|
@ -43,7 +42,7 @@ func main() {
|
|||
defer f.Close()
|
||||
|
||||
fmt.Fprintf(f, "\nTotal pages checked: %d\n\n", checker.pagesChecked)
|
||||
|
||||
|
||||
if len(brokenLinks) == 0 {
|
||||
fmt.Fprintf(f, "No issues found!\n")
|
||||
fmt.Printf("Results written to %s\n", filename)
|
||||
|
@ -81,8 +80,8 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
fmt.Fprintf(f, "\nTotal issues: %d (%d redirects, %d broken)\n",
|
||||
fmt.Fprintf(f, "\nTotal issues: %d (%d redirects, %d broken)\n",
|
||||
len(brokenLinks), redirectCount, brokenCount)
|
||||
|
||||
|
||||
fmt.Printf("Results written to %s\n", filename)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue