Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Trim spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
fourcube committed Apr 15, 2015
1 parent 7caf8f0 commit ff423d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions countries/be.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package countries
import (
"fmt"
"strconv"
"strings"
)

type BelgiumFileEntry struct {
Expand All @@ -48,9 +49,9 @@ func BelgiumRowToEntry(row []string) []BelgiumFileEntry {

for lowerBankcodeBound <= upperBankcodeBound {
entries = append(entries, BelgiumFileEntry{
Bankcode: fmt.Sprintf("%03d", lowerBankcodeBound),
Name: row[3],
Bic: row[2],
Bankcode: strings.TrimSpace(fmt.Sprintf("%03d", lowerBankcodeBound)),
Name: strings.TrimSpace(row[3]),
Bic: strings.TrimSpace(row[2]),
})

lowerBankcodeBound++
Expand Down
8 changes: 5 additions & 3 deletions countries/nl.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ THE SOFTWARE.
*/
package countries

import "strings"

type NetherlandsFileEntry struct {
Bankcode string
Name string
Expand All @@ -33,8 +35,8 @@ type NetherlandsFileEntry struct {
// Bankcodes
func NetherlandsRowToEntry(row []string) NetherlandsFileEntry {
return NetherlandsFileEntry{
Bankcode: row[0],
Name: row[2],
Bic: row[1],
Bankcode: strings.TrimSpace(row[0]),
Name: strings.TrimSpace(row[2]),
Bic: strings.TrimSpace(row[1]),
}
}

0 comments on commit ff423d8

Please sign in to comment.