Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dig: use our dig fork #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

dig: use our dig fork #2

wants to merge 1 commit into from

Conversation

alexisvisco
Copy link
Member

No description provided.

@@ -57,18 +59,18 @@ func (r *Router) Delete(path string, handler any) {
r.Route(http.MethodDelete, path, handler)
}

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.Env == "" {
app.Env = AppEnvDevelopment
}

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.

1 participant