Skip to content

Commit

Permalink
Added some extra trims to remove whitespace mid-line
Browse files Browse the repository at this point in the history
  • Loading branch information
cbednarski committed Jun 6, 2015
1 parent 5df9c0f commit 09ada4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hostfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 09ada4c

Please sign in to comment.