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

code gen should generate controller constructor that returns concret type instead of interface #416

Open
2 tasks done
TimShi opened this issue May 31, 2024 · 0 comments
Open
2 tasks done

Comments

@TimShi
Copy link
Contributor

TimShi commented May 31, 2024

Description

Expected Behavior

It should generate constructor that returns the concrete type that implements this interface

func NewExampleFriendsController(r *repository.FriendsRepository) *ExampleFriendsController {

Actual Behavior

Currently, code gen generates controller constructor that returns web.Controller interface.

func NewExampleFriendsController(di exampleFriendsControllerDI) web.Controller {

This makes it hard to inject this specific controller instance into test if there are multiple controllers in the test.

Affected Version

v0.14.0

Steps to Reproduce

Follow the README in examples/database to generate the service based on contract.

Checklist

@TimShi TimShi changed the title code gen should generate controller constructor that returns concrent type instead of interface code gen should generate controller constructor that returns concret type instead of interface Jun 28, 2024
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

No branches or pull requests

1 participant