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

Custom types on interface #98

Closed
khafidprayoga opened this issue Oct 24, 2022 · 3 comments
Closed

Custom types on interface #98

khafidprayoga opened this issue Oct 24, 2022 · 3 comments

Comments

@khafidprayoga
Copy link

how i can write custom types on interface definition
for example
type ProductHandler interface { ProductDetail() fiber.handler }

@TorbenHammes
Copy link

TorbenHammes commented Oct 27, 2022

How did you completed it? @khafidprayoga @dave

@khafidprayoga
Copy link
Author

@TorbenHammes

	domain := jen.NewFile("domain")
	domain.ImportName("github.com/gofiber/fiber/v2", "fiber")



	domain.Type().Id("ProductHandler").Interface(
		jen.Id("ProductDetail").Params().Qual("github.com/gofiber/fiber/v2", "Handler"),
	)

@TorbenHammes
Copy link

Thank you @khafidprayoga

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

2 participants