Skip to content

[Enhancement]: Cannot test a Type with the same name as the parsed type because of name overlapping #35

@leorolland

Description

@leorolland

Contact Details

No response

What is the problem?

We cannot generate a Type with the same name as the parsed type because of name overlapping.

Ex.

package main

type Human struct {
	//+required
	Firstname string
	//+required
	Lastname string
	Age uint
}

Template

package main

type {{ .Type.InternalName }}) struct {}

if you want genz tests, you will have both human.go and expected.go in the same package, with the name Human overlapping

What is the solution?

Quickfix https://github.com/Joffref/genz/tree/expected-in-dir

Why is this important?

No response

What are the alternatives?

to discuss

What is the impact?

blocker for some cases

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions