derision-test / go-mockgen

MIT License
57 stars 7 forks source link

Generating mocks on Windows fails when package name contains separators. #17

Closed ErnestsKalnins closed 2 years ago

ErnestsKalnins commented 2 years ago

When generating mocks on Windows, if the target interface is in a nested package, the generator fails with this message:

go-mockgen: error: package name 'foo\bar\baz' is illegal, try --help app\gen.go:3: running "go-mockgen": exit status 1

I believe this line is the culprit https://github.com/derision-test/go-mockgen/blob/master/cmd/go-mockgen/args.go#L115, instead of using "/", you could use os.PathSeparator.