Skip to content

Conversation

leninhasda
Copy link
Contributor

Add support for go module when running generate command
Typo fix

This changes how generate command looks for import path. Now it will
try to find go.mod file and determine import path from there first,
and will fallback to old way otherwise.

Ref:
Two functions I used are from original go source code:

[Fixes #524]

Typo fix

This changes how `generate` command looks for import path. Now it will
try to find `go.mod` file and determine import path from there first,
and will fallback to old way otherwise.

[Fixes onsi#524]
@kvptkr
Copy link

kvptkr commented Oct 18, 2019

@onsi Who would be best to review this? This is a pain point now that modules are GA

@blgm
Copy link
Collaborator

blgm commented Oct 23, 2019

Hi @kvptkr @leninhasda. The implementation here looks good and has worked for me when I have tried it out. The thing that this PR is missing is some tests, which could live here: https://github.com/onsi/ginkgo/blob/master/integration/subcommand_test.go#L16

@blgm blgm merged commit 9c89e3f into onsi:master Nov 19, 2019
blgm added a commit that referenced this pull request Nov 19, 2019
This is a follow-on to commit 9c89e3f
added in PR #578
@blgm
Copy link
Collaborator

blgm commented Nov 19, 2019

@leninhasda, thank you for this contribution. It's a valuable improvement. I have added a test for it in commit 8892a1d as this will hopefully reduce the chance of this being accidentally broken in the future. If you can see any potential improvement to the testing, then please feel free to submit another PR.

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

Successfully merging this pull request may close these issues.

ginkgo generate fails in module
3 participants