diff --git a/decorate_test.go b/decorate_test.go index 87db3f57d..fb60f233a 100644 --- a/decorate_test.go +++ b/decorate_test.go @@ -234,7 +234,7 @@ func TestDecorateSuccess(t *testing.T) { defer app.RequireStart().RequireStop() }) - t.Run("transitive and scoped decorations", func(t *testing.T) { + t.Run("ineffective transitive decoration", func(t *testing.T) { type Config struct { Scope string } @@ -254,8 +254,10 @@ func TestDecorateSuccess(t *testing.T) { fx.Decorate(func() *Config { return &Config{Scope: "child"} }), + // Logger does not get replaced since it was provided + // from a different Scope. fx.Invoke(func(l *Logger) { - assert.Equal(t, "child logger", l.Cfg.Scope) + assert.Equal(t, "root logger", l.Cfg.Scope) }), ), ) diff --git a/go.mod b/go.mod index 0285efbf1..2dfc5b03d 100644 --- a/go.mod +++ b/go.mod @@ -12,4 +12,4 @@ require ( golang.org/x/sys v0.0.0-20210903071746-97244b99971b ) -replace go.uber.org/dig => github.com/uber-go/dig v1.13.1-0.20220217170604-a7e23e31e975 +replace go.uber.org/dig => github.com/uber-go/dig v1.13.1-0.20220225222603-677f64b9c694 diff --git a/go.sum b/go.sum index 640af25f4..f82117b1c 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/uber-go/dig v1.13.1-0.20220217170604-a7e23e31e975 h1:DThTt5qayrILkBHJQIu19u38oTPaWH/LU+RxMLz0/tA= -github.com/uber-go/dig v1.13.1-0.20220217170604-a7e23e31e975/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o= +github.com/uber-go/dig v1.13.1-0.20220225222603-677f64b9c694 h1:0PS9oNOB6x8htJywKfuZ2jx3Ax9F8YlImH31Rb/Hc2E= +github.com/uber-go/dig v1.13.1-0.20220225222603-677f64b9c694/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=