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

flaky tag vallue accessor #4

Open
blaggacao opened this issue Nov 13, 2020 · 2 comments
Open

flaky tag vallue accessor #4

blaggacao opened this issue Nov 13, 2020 · 2 comments

Comments

@blaggacao
Copy link

	string string `enum:"local,remote" meta:"new"`

erroneously renders:

// Remote" meta:"new returns the <no value> PartyType.
func Remote" meta:"new() PartyType {
	return PartyType{
		string: "remote" meta:"new",
	}
}
@blaggacao
Copy link
Author

blaggacao commented Nov 13, 2020

an easy fix ...

reflect.StructTag(structType.Tag(i))
structTagDDDKeyValue, ok := tag.Lookup(structTagDDDKey)
/// then do regex match on this value

https://github.com/xoe-labs/go-generators/blob/666e9681d6121bce0a4e35a375c58e69ddd34b88/ddd-domain-gen/pkg/generate/main.go#L136-L140

@blaggacao
Copy link
Author

Same goes for metatag, btw.

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