matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
2k stars 127 forks source link

Error on M1 Mac when generating mocks with confluent-kafka-go dependency #176

Open lazorfuzz opened 2 years ago

lazorfuzz commented 2 years ago

Hi, I'm using an M1 mac to generate mocks for a kafka producer which depends on the confluent-kafka-go package. When attempting to generate, moq exits with the below error.

go generate -tags dynamic ./...
couldn't load source package: /workspace/mercury/internal/kafka/producers/invalidation_producer.go:94:66: cannot use kafka.PartitionAny (constant unknown with invalid type) as int32 value in struct literal

On non-m1 macs, I can successfully generate the mocks without the -tags dynamic build tag.

matryer commented 2 years ago

I guess here the issue is that the kafka.PartitionAny type isn't tagged with the dynamic build tag - so it's not included? Is that worth ruling out?