From 3a7a21f97ea5bc9b44640908f9a44cca4fa0525c Mon Sep 17 00:00:00 2001 From: Erik Winter Date: Sat, 1 Feb 2025 12:08:23 +0100 Subject: [PATCH] refactor: Remove unused import and clean up whitespace --- main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 57cc820..22e9af5 100644 --- a/main.go +++ b/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) }