Skip to content

Conversation

@alexisvisco
Copy link
Member

No description provided.

}

func (r *Router) getHttpHandler(handler any) http.Handler {
func (r *Router) getHttpHandler(handler any) (http.Handler, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add error return type here

Container struct {
values map[reflect.Type]reflect.Value
}
AppEnv string
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add type alias string for AppEnv (for convenience)

if app.Logger == nil {
if app.Env == AppEnvProduction {
app.Logger = panicOnError(zap.NewProduction())
app.Logger = lo.Must(zap.NewProduction())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of lo library to just not create code not tested

}
}
return returnValues, nil
func ProvideSingleValueFunc[T any](v T) func() T {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add utility func to pass single value as function for Provide

Comment on lines +16 to +23
// Note on github.com/expectedsh/dig, this is a fork of go.uber.org/dig
// Our fork is needed to add outputs informations for an invoke
// A merge request is opened, waiting for the merge
// When the merge will occur we could remove this fork and use the official dig package
//
// The fork contains two branches :
// - the master branch is the same as the official dig package
// - the expected branch contains the changes we made to add outputs informations for an invoke and replaced go.mod module name
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our dig is temporary but if the merge request is declined, we can handle that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants