Comments (2)
I have this issue.
Here's my suggestion: try editing ~/go/src/matryer/moq/main.go, finding the line containing fmt.Errorf("go/format
, change it to return fmt.Errorf("go/format: %s | %s", err, string(buf.Bytes()))
, and run go build
(from the moq folder).
Then find the moq commandline by searching for go:generate
in your project, then run ../../moq ...etc...
in your project's folder. This will let you see the code that moq is generating that is breaking the formatter, and will let you know which types are causing it to fail.
In my case it's generating *invalid type
in the code, which I don't have the answer to yet.
from moq.
A couple of changes have been introduced in relation to this issue. For one, we are now checking errors on loading the package info (70fed06) which should fail fast with appropriate error message returned from golang.org/x/tools/go/packages. Additionally, a new formatter option, noop
can be used to print the generated source code without attempting to format it (which could fail when the generated code is not valid). Hope that helps.
from moq.
Related Issues (20)
- Error if field type and method have the same name HOT 3
- Generate mock for external library HOT 2
- Generate mocks for interfaces with generic types HOT 5
- Error on M1 Mac when generating mocks with confluent-kafka-go dependency HOT 1
- Moq ignores package names of arguments of generic types HOT 4
- Is there a way to speed up the moq generation time? HOT 14
- Feature to register multiple mock functions to a method HOT 2
- Moq creates non-unique import aliases HOT 3
- API for argument-based assertions HOT 2
- Instructions on readme inst matching the current version
- Support for mocking core types HOT 8
- Q. `--with-calls` option to generate functions to track and inspect the calls made to a mock HOT 2
- Not installing for go 1.15 HOT 3
- Support non-basic type constraints HOT 1
- error: couldn't load source package
- Self import issue HOT 2
- Error while re-generate mock
- PROPOSAL: Integration with vektra/mockery HOT 10
- Moq failing when encountering a generic function HOT 1
- feat: Allow generation of mocked interface that depends on other mocked interfaces from different packages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moq.