diff --git a/pkg/ottl/expression_test.go b/pkg/ottl/expression_test.go index cfd9f24b03c0..c00fef22af43 100644 --- a/pkg/ottl/expression_test.go +++ b/pkg/ottl/expression_test.go @@ -679,7 +679,7 @@ func Test_StandardStringGetter(t *testing.T) { func Test_StandardStringGetter_WrappedError(t *testing.T) { getter := StandardStringGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) @@ -825,7 +825,7 @@ func Test_StandardStringLikeGetter(t *testing.T) { func Test_StandardStringLikeGetter_WrappedError(t *testing.T) { getter := StandardStringLikeGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) @@ -901,7 +901,7 @@ func Test_StandardFloatGetter(t *testing.T) { func Test_StandardFloatGetter_WrappedError(t *testing.T) { getter := StandardFloatGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) @@ -1077,7 +1077,7 @@ func Test_StandardFloatLikeGetter(t *testing.T) { func Test_StandardFloatLikeGetter_WrappedError(t *testing.T) { getter := StandardFloatLikeGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) @@ -1153,7 +1153,7 @@ func Test_StandardIntGetter(t *testing.T) { func Test_StandardIntGetter_WrappedError(t *testing.T) { getter := StandardIntGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) @@ -1329,7 +1329,7 @@ func Test_StandardIntLikeGetter(t *testing.T) { func Test_StandardIntLikeGetter_WrappedError(t *testing.T) { getter := StandardIntLikeGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) @@ -1415,7 +1415,7 @@ func Test_StandardPMapGetter(t *testing.T) { func Test_StandardPMapGetter_WrappedError(t *testing.T) { getter := StandardPMapGetter[interface{}]{ Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", TypeError("")) + return nil, TypeError("") }, } _, err := getter.Get(context.Background(), nil) diff --git a/pkg/ottl/ottlfuncs/func_is_map_test.go b/pkg/ottl/ottlfuncs/func_is_map_test.go index 69b49e34eb08..ab83866ecfd5 100644 --- a/pkg/ottl/ottlfuncs/func_is_map_test.go +++ b/pkg/ottl/ottlfuncs/func_is_map_test.go @@ -5,7 +5,6 @@ package ottlfuncs import ( "context" - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -63,7 +62,7 @@ func Test_IsMap(t *testing.T) { func Test_IsMap_Error(t *testing.T) { exprFunc := isMap[any](&ottl.StandardPMapGetter[any]{ Getter: func(context.Context, interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", ottl.TypeError("")) + return nil, ottl.TypeError("") }, }) _, err := exprFunc(context.Background(), nil) diff --git a/pkg/ottl/ottlfuncs/func_is_string_test.go b/pkg/ottl/ottlfuncs/func_is_string_test.go index 225fa2198fb2..623c3e84a515 100644 --- a/pkg/ottl/ottlfuncs/func_is_string_test.go +++ b/pkg/ottl/ottlfuncs/func_is_string_test.go @@ -5,7 +5,6 @@ package ottlfuncs import ( "context" - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -63,7 +62,7 @@ func Test_IsString(t *testing.T) { func Test_IsString_Error(t *testing.T) { exprFunc := isString[any](&ottl.StandardStringGetter[any]{ Getter: func(context.Context, interface{}) (interface{}, error) { - return nil, fmt.Errorf("not a TypeError: %w", ottl.TypeError("")) + return nil, ottl.TypeError("") }, }) _, err := exprFunc(context.Background(), nil)