mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2025-01-18 07:51:40 +03:00
fix linters
This commit is contained in:
parent
61618bc7f8
commit
81ce0c4ba8
@ -179,7 +179,6 @@ func getUzbekistanNationalNumber(phone string, parsedPhone *pn.PhoneNumber) (uin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getMexicanNationalNumber(parsedPhone *pn.PhoneNumber) (uint64, error) {
|
func getMexicanNationalNumber(parsedPhone *pn.PhoneNumber) (uint64, error) {
|
||||||
result := parsedPhone.GetNationalNumber()
|
|
||||||
phoneWithDigit := fmt.Sprintf("1%d", parsedPhone.GetNationalNumber())
|
phoneWithDigit := fmt.Sprintf("1%d", parsedPhone.GetNationalNumber())
|
||||||
|
|
||||||
num, err := strconv.Atoi(phoneWithDigit)
|
num, err := strconv.Atoi(phoneWithDigit)
|
||||||
@ -188,8 +187,7 @@ func getMexicanNationalNumber(parsedPhone *pn.PhoneNumber) (uint64, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result = uint64(num)
|
return uint64(num), nil //nolint:gosec
|
||||||
return result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCountryCode(phone string) string {
|
func getCountryCode(phone string) string {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -119,7 +120,7 @@ func TestFormatNumberForWA(t *testing.T) {
|
|||||||
|
|
||||||
for orig, expected := range numbers {
|
for orig, expected := range numbers {
|
||||||
actual, err := FormatNumberForWA(orig)
|
actual, err := FormatNumberForWA(orig)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expected, actual)
|
require.Equal(t, expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user