-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
// 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 |
There was a problem hiding this comment.
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.
No description provided.