From 8a9c929e34c255ee81315b9ebe524919c65587d0 Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Tue, 26 Aug 2025 11:18:03 -0700 Subject: [PATCH] s/interface{}/any --- di_test.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/di_test.go b/di_test.go index 29d4812447d25955d040dcec6511d98ce14748ff..1688837c502f01d616b96280e7c58cc92181ad2a 100644 --- a/di_test.go +++ b/di_test.go @@ -119,9 +119,9 @@ func TestBuildSuccess(t *testing.T) { tests := []struct { name string - config interface{} - result interface{} - verify func(t *testing.T, result interface{}) + config any + result any + verify func(t *testing.T, result any) }{ { name: "complex dependencies with providers", @@ -147,7 +147,7 @@ func TestBuildSuccess(t *testing.T) { A *A B *B }{}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { A *A B *B @@ -191,7 +191,7 @@ func TestBuildSuccess(t *testing.T) { result: &struct { A *A }{}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { A *A }) @@ -218,7 +218,7 @@ func TestBuildSuccess(t *testing.T) { A *A B *B }{}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { A *A B *B @@ -240,7 +240,7 @@ func TestBuildSuccess(t *testing.T) { result: &struct { A ANum }{}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { A ANum }) @@ -273,7 +273,7 @@ func TestBuildSuccess(t *testing.T) { A int B uint }{}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { A int B uint @@ -311,10 +311,10 @@ func TestBuildErrors(t *testing.T) { tests := []struct { name string - config interface{} - result interface{} + config any + result any expectedErrors []string - verify func(t *testing.T, result interface{}) + verify func(t *testing.T, result any) }{ { name: "constructor error propagation", @@ -329,7 +329,7 @@ func TestBuildErrors(t *testing.T) { A *A }{}, expectedErrors: []string{"MakeA", "boom"}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { A *A }) @@ -351,7 +351,7 @@ func TestBuildErrors(t *testing.T) { B *B }{}, expectedErrors: []string{"*di.A", "di.A"}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { B *B }) @@ -378,7 +378,7 @@ func TestBuildErrors(t *testing.T) { Y *Y }{}, expectedErrors: []string{"MakeX", "MakeY"}, - verify: func(t *testing.T, result interface{}) { + verify: func(t *testing.T, result any) { res := result.(*struct { X *X Y *Y @@ -419,8 +419,8 @@ func TestNewFunction(t *testing.T) { tests := []struct { name string - config interface{} - expected interface{} + config any + expected any }{ { name: "struct result", @@ -465,7 +465,7 @@ func TestNewFunction(t *testing.T) { func TestBuildPrimitiveTypes(t *testing.T) { tests := []struct { name string - config interface{} + config any expected int }{ {