From 09ada4cfb264e2467604c1e1026d129c8f459a3e Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Fri, 5 Jun 2015 23:44:49 -0700 Subject: [PATCH] Added some extra trims to remove whitespace mid-line --- hostfile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hostfile.go b/hostfile.go index 5809035..78aaf58 100644 --- a/hostfile.go +++ b/hostfile.go @@ -93,9 +93,13 @@ func ParseLine(line string) Hostlist { for strings.Contains(line, " ") { line = strings.Replace(line, " ", " ", -1) } + line = TrimWS(line) // Break line into words words := strings.Split(line, " ") + for idx, word := range words { + words[idx] = TrimWS(word) + } // Separate the first bit (the ip) from the other bits (the domains) ip := words[0]