interfaces
interfaces copied to clipboard
Ignore specified embedded fields when generating an interface
Would you accept a PR that allows specifying ignored embedded fields?
My use case:
type DB struct {
*underlyingDB.Client
}
func (db *DB) CreateUser() {}
I'd like to exclude methods from underlyingDB.Client
.
do you think -ignore Field1,Field2
would be a good argument format?
Hmm, looks like this is not easy to implement performatively.
I initially thought listing the field names after if !field.Anonymous()
should be enough, but it seems the external packages are still walked.
I think it would be good addition