You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I need to write unit-test, which need gomock, and it need interface
Describe the solution you'd like
package logic
type UserLogic interface {
UserCreate(in *user.UserReq) (*user.UserResp, error)
UserDelete(in *user.UserReq) (*user.UserResp, error)
}
type UserLogicV1 struct {
UserRepo repository.UserRepository
}
// compile-time checking if UserLogicV1 implement UserLogic interface
var _ UserLogic = (*UserLogicV1)(nil)
// return the concrete implementation instead of interface, as Go style suggests
func NewUserLogicV1(userRepo repository.UserRepository) *UserLogicV1 {
return &UserLogicV1{
UserRepo: userRepo,
}
}
Describe alternatives you've considered
currently no
Additional context
currently no
The text was updated successfully, but these errors were encountered:
Linde7777
changed the title
It is possible to support interface(in Object-oriented programming) in goctl?
Is it possible to support interface(in Object-oriented programming) in goctl?
May 7, 2024
Linde7777
changed the title
Is it possible to support interface(in Object-oriented programming) in goctl?
Is it possible to support interface in goctl?
May 7, 2024
Is your feature request related to a problem? Please describe.
I need to write unit-test, which need gomock, and it need interface
Describe the solution you'd like
Describe alternatives you've considered
currently no
Additional context
currently no
The text was updated successfully, but these errors were encountered: