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

eywagen: avoid generating fields file if all models are skipped #10

Open
scriptnull opened this issue Jun 10, 2024 · 0 comments
Open

eywagen: avoid generating fields file if all models are skipped #10

scriptnull opened this issue Jun 10, 2024 · 0 comments

Comments

@scriptnull
Copy link
Collaborator

I had one model for which I didn't implement the eywa.Model interface. So running go generate ./... resulted in

struct type Deployment does not implement eywa.Model interface, skipping...

But at the same time, a file that leads to a compile error is added to the package.

// generated by eywa. DO NOT EDIT. Any changes will be overwritten.
package model

import (
	"github.com/imperfect-fourth/eywa"
)

Error is

$ go run main.go 
model/eywa_fields.go:5:2: "github.com/imperfect-fourth/eywa" imported and not used

So let us avoid writing this file if there is no model implementing the interface.

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