-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
V2 Feature Request: add lifecycle interface support #61
Comments
I agree. I often add a small When would you call this method?
|
I think there is a bit difference between init() method and the case I describe. as go init() is package level and too many init method in a package is not a good practice(my opinion). my case is somelike "constructor" behavior, it should be called by the framework right after the service creation. not sure I address the case well or not. |
I have Java background , in springboot there is a interface named InitializingBean this interface give an opportunity to do some one-time initialization. We can introduce similar interface, service implement this interface will call the method automatically once after the service creation.
The text was updated successfully, but these errors were encountered: