From 01e82b1b908689f3da6cf5a1a66072f12d279378 Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Thu, 4 Aug 2022 14:33:24 -0700 Subject: [PATCH] gofmt --- inout.go | 108 +++++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/inout.go b/inout.go index ca72cf351..394cad71d 100644 --- a/inout.go +++ b/inout.go @@ -169,22 +169,22 @@ import "go.uber.org/dig" // A soft group will be populated only with values from already-executed // constructors. // -// type Params struct { -// fx.In +// type Params struct { +// fx.In // -// Handlers []Handler `group:"server"` -// Logger *zap.Logger -// } +// Handlers []Handler `group:"server"` +// Logger *zap.Logger +// } // -// NewHandlerAndLogger := func() (Handler, *zap.Logger) { ... } -// NewHandler := func() Handler { ... } -// Foo := func(Params) { ... } +// NewHandlerAndLogger := func() (Handler, *zap.Logger) { ... } +// NewHandler := func() Handler { ... } +// Foo := func(Params) { ... } // -// app := fx.New( -// fx.Provide(NewHandlerAndLogger), -// fx.Provide(NewHandler), -// fx.Invoke(Foo), -// ) +// app := fx.New( +// fx.Provide(NewHandlerAndLogger), +// fx.Provide(NewHandler), +// fx.Invoke(Foo), +// ) // // The only constructor called is `NewHandler`, because this also provides // `*zap.Logger` needed in the `Params` struct received by `foo` @@ -192,47 +192,47 @@ import "go.uber.org/dig" // In the next example, the slice `s` isn't populated as the provider would be // called only because of `strings` soft group value // -// app := fx.New( -// fx.Provide( -// fx.Annotate( -// func() (string,int) { return "hello" }, -// fx.ResultTags(`group:"strings"`), -// ), -// ), -// fx.Invoke( -// fx.Annotate(func(s []string) { -// // s will be an empty slice -// }, -// fx.ParamTags(`group:"strings,soft"`), -// ), -// ), -// ) -// -// In the next example, the slice `s` will be populated because there is a -// consumer for the same type which hasn't a `soft` dependency -// -// app := fx.New( -// fx.Provide( -// fx.Annotate( -// func() string { "hello" }, -// fx.ResultTags(`group:"strings"`), -// ), -// ), -// fx.Invoke( -// fx.Annotate(func(b []string) { -// // b will be ["hello"] -// }, -// fx.ParamTags(`group:"strings"`), -// ), -// ), -// fx.Invoke( -// fx.Annotate(func(s []string) { -// // s will be ["hello"] -// }, -// fx.ParamTags(`group:"strings,soft"`), -// ), -// ), -// ) +// app := fx.New( +// fx.Provide( +// fx.Annotate( +// func() (string,int) { return "hello" }, +// fx.ResultTags(`group:"strings"`), +// ), +// ), +// fx.Invoke( +// fx.Annotate(func(s []string) { +// // s will be an empty slice +// }, +// fx.ParamTags(`group:"strings,soft"`), +// ), +// ), +// ) +// +// In the next example, the slice `s` will be populated because there is a +// consumer for the same type which hasn't a `soft` dependency +// +// app := fx.New( +// fx.Provide( +// fx.Annotate( +// func() string { "hello" }, +// fx.ResultTags(`group:"strings"`), +// ), +// ), +// fx.Invoke( +// fx.Annotate(func(b []string) { +// // b will be ["hello"] +// }, +// fx.ParamTags(`group:"strings"`), +// ), +// ), +// fx.Invoke( +// fx.Annotate(func(s []string) { +// // s will be ["hello"] +// }, +// fx.ParamTags(`group:"strings,soft"`), +// ), +// ), +// ) // // # Unexported fields //