Skip to content

Commit

Permalink
Enhance go project detection by referring to go.mod file (#1418)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rudle authored and bbatsov committed Jun 4, 2019
1 parent 98808e6 commit 65ba429
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [#982](https://github.com/bbatsov/projectile/issues/982) Add heuristic for projectile-find-matching-test
* Support a list of functions for `related-files-fn` options and helper functions
* [#1405](https://github.com/bbatsov/projectile/pull/1405) Add Bloop Scala build server project detection
* [#1418](https://github.com/bbatsov/projectile/pull/1418) The presence of a go.mod file implies a go project
* [#1419](https://github.com/bbatsov/projectile/pull/1419) When possible, use [fd](https://github.com/sharkdp/fd) instead
of `find` to list the files of a non-VCS project. This should be much faster.

Expand Down
3 changes: 2 additions & 1 deletion projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,8 @@ test/impl/other files as below:

(defun projectile-go-project-p ()
"Check if a project contains Go source files."
(projectile-verify-file-wildcard "*.go"))
(or (projectile-verify-file "go.mod")
(projectile-verify-file-wildcard "*.go")))

(define-obsolete-variable-alias 'projectile-go-function 'projectile-go-project-test-function "1.0.0")
(defcustom projectile-go-project-test-function #'projectile-go-project-p
Expand Down

0 comments on commit 65ba429

Please sign in to comment.