Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions countries/belgium.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package countries
import (
"math"
"strconv"

"github.com/ltns35/go-vat/countries/utils"
)

type belgium struct {
Expand All @@ -21,7 +19,7 @@ var Belgium = belgium{
},
Rules: CountryRules{
Regex: []string{
"^(BE)(0?\\d{9})$",
"^(BE)([01]?\\d{9})$",
},
},
},
Expand All @@ -34,11 +32,6 @@ func (b belgium) Calc(vat string) bool {
newVat = "0" + vat
}

numAtFirstIndex := utils.IntAt(newVat, 1)
if numAtFirstIndex == 0 {
return false
}

strNum := newVat[:8]
num, _ := strconv.Atoi(strNum)

Expand Down
9 changes: 5 additions & 4 deletions countries/mocks/belgium.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ var BelgiumValidTests = []string{
"BE0887434390",
"BE0830986627",
"BE0413172884",
"BE0000200334",
"BE1602602623",
"BE1400521335",
"BE1400004463",
"BE1012609724",
"BE200000340",
"BE231000253",
"BE454004738",
Expand Down Expand Up @@ -231,11 +236,7 @@ var BelgiumInvalidTests = []string{
"BE8972226a80",
"BE89722268a0",
"BE897222680a",
"BE1602602623",
"BE1400521335",
"BE1400521330",
"BE0000200334",
"BE1400004463",
"BE0603601206",
"BE603601206",
"BE60260262",
Expand Down
2 changes: 1 addition & 1 deletion validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ func TestCheckVAT(t *testing.T) {
}

if got.IsValid != arg.want {
t.Errorf("Validate() got = %v, want %v", got, arg.want)
t.Errorf("Validate() got = %+v, want %+v", got, arg.want)
}
},
)
Expand Down