fix linters

This commit is contained in:
Руслан 2024-12-23 17:54:10 +03:00
parent 61618bc7f8
commit 81ce0c4ba8
2 changed files with 5 additions and 6 deletions

View File

@ -179,7 +179,6 @@ func getUzbekistanNationalNumber(phone string, parsedPhone *pn.PhoneNumber) (uin
}
func getMexicanNationalNumber(parsedPhone *pn.PhoneNumber) (uint64, error) {
result := parsedPhone.GetNationalNumber()
phoneWithDigit := fmt.Sprintf("1%d", parsedPhone.GetNationalNumber())
num, err := strconv.Atoi(phoneWithDigit)
@ -188,8 +187,7 @@ func getMexicanNationalNumber(parsedPhone *pn.PhoneNumber) (uint64, error) {
return 0, err
}
result = uint64(num)
return result, nil
return uint64(num), nil //nolint:gosec
}
func getCountryCode(phone string) string {

View File

@ -1,9 +1,10 @@
package util
import (
"github.com/stretchr/testify/require"
"testing"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
)
@ -119,7 +120,7 @@ func TestFormatNumberForWA(t *testing.T) {
for orig, expected := range numbers {
actual, err := FormatNumberForWA(orig)
assert.NoError(t, err)
assert.Equal(t, expected, actual)
require.NoError(t, err)
require.Equal(t, expected, actual)
}
}