From 47c64f6106d49a88c5cb5b95e2f44e56fd8e8f37 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Fri, 29 May 2020 20:19:13 -0600 Subject: [PATCH] always trim space around each cell in the csv file --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index bceba3e..a70b52c 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ func main() { } // Create a new instance of type Redirect and populate with data from CSV file - redirect := Redirect{sourceURL: row[0], destinationURL: row[1]} + redirect := Redirect{sourceURL: strings.TrimSpace(row[0]), destinationURL: strings.TrimSpace(row[1])} redirect.statusCode, err = strconv.Atoi(strings.TrimSpace(row[2])) if err != nil { log.Printf("skipping row: failed to convert status code '%s' to integer: %v", row[2], err)