fix: err code 迁移到各自的包下 (#65)

This commit is contained in:
libin
2024-04-03 10:37:59 +08:00
committed by GitHub
parent 0a5162c6ca
commit ef397cab50
24 changed files with 123 additions and 108 deletions

View File

@@ -1,7 +1,6 @@
package jsonUtil
import (
go_easy_utils "github.com/jefferyjob/go-easy-utils/v2"
"reflect"
"testing"
)
@@ -44,8 +43,8 @@ func TestToFloat64(t *testing.T) {
{true, 1, nil},
{false, 0, nil},
{(*bool)(nil), 0, nil},
{make(chan int), 0, go_easy_utils.ErrType},
{"abc", 0, go_easy_utils.ErrSyntax},
{make(chan int), 0, ErrType},
{"abc", 0, ErrSyntax},
}
for _, tc := range testCases {
@@ -90,7 +89,7 @@ func TestToFloat64Pointer(t *testing.T) {
name: "invalid string input",
input: stringPtr("abc"),
expectedValue: 0,
expectedError: go_easy_utils.ErrSyntax,
expectedError: ErrSyntax,
},
{
name: "valid string input",
@@ -186,7 +185,7 @@ func TestToFloat64Pointer(t *testing.T) {
name: "unsupported input type",
input: "unsupported",
expectedValue: 0,
expectedError: go_easy_utils.ErrSyntax,
expectedError: ErrSyntax,
},
}