Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance go project detection by referring to go.mod file #1418

Merged
merged 3 commits into from
Jun 4, 2019

Conversation

rudle
Copy link
Contributor

@rudle rudle commented May 21, 2019

This PR fixes an issue encountered when working in a go project that doesn't have any .go files at the root. The fix is to check for a go.mod file at the root of the project, avoiding a recursive descent of the project. The go.mod file is new-ish and will be present in projects that are using Go modules. The file will be present in all (or almost all) Go projects when Go 1.13 is released later this year.

I didn't add any tests, but this is the fix I applied to my local install of projectile and it worked great.

Feel free to remove or tweak my Changelog entry, this change may not be big enough to warrant documentation.

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (make test)
  • The new code is not generating bytecode or M-x checkdoc warnings
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

@rudle rudle changed the title enhance go project detection by referring to go.mod file Enhance go project detection by referring to go.mod file May 21, 2019
projectile.el Outdated Show resolved Hide resolved
Sean Sorrell added 3 commits June 3, 2019 17:08
This file is present in many (but not all) go projects. When go 1.13 comes out
later this year, the go.mod file might become a sufficient check for a go
project but today that is not the case.
@rudle rudle force-pushed the enhance-go-project-detection branch from 9748d99 to c3ec56d Compare June 4, 2019 00:09
@rudle
Copy link
Contributor Author

rudle commented Jun 4, 2019

Thanks for the review. Feedback and merge conflicts have been addressed.

@bbatsov bbatsov merged commit 65ba429 into bbatsov:master Jun 4, 2019
@bbatsov
Copy link
Owner

bbatsov commented Jun 4, 2019

Thanks!

@rudle rudle deleted the enhance-go-project-detection branch June 4, 2019 18:24
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.

2 participants