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

This reverts commit ef397cab50.
This commit is contained in:
libin
2024-04-03 10:46:39 +08:00
committed by GitHub
parent ef397cab50
commit b5654c2b4b
24 changed files with 108 additions and 123 deletions

View File

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