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

.Interface.Methods no longer contains nested methods #65

Open
Dafaque opened this issue Mar 3, 2023 · 2 comments
Open

.Interface.Methods no longer contains nested methods #65

Dafaque opened this issue Mar 3, 2023 · 2 comments

Comments

@Dafaque
Copy link

Dafaque commented Mar 3, 2023

proofOfBug.tpl:

{{range $method := .Interface.Methods}}
func {{$method.Declaration}}{}
{{end}}

proofOfBug.go:

//go:generate gowrap gen -g  -v DecoratorName=POC -i Base -t proofOfBug.tpl -o proofOfBug.gen.go
type Base interface {
	A()
	Nested
}

type Nested interface {
	B()
}

version 1.2.7 did not ignore nesteds

@NoGambiNoBugs
Copy link

@hexdigest I'm sorry for answering so late, the problem was very simple, when we mapping the types of files we also check if the type is the target, if is then we save in selectedType, but this func has two purpose, first is mapping the types and second is return the target type. The fix was just change a return to continue, but if you prefer can be removed because there are nothing after this condition.

@Dafaque your example it wasn't working because the nested struct was declared after the target struct, but already is working with this PR #68. Here is an example:

@Dafaque
Copy link
Author

Dafaque commented Mar 7, 2023

Thanx a lot!

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