Skip to content

Commit

Permalink
Merge pull request #723 from forelabs/package_managers/go-15-vendor-e…
Browse files Browse the repository at this point in the history
…xperiment-detection-fix

Go15VendorExperiment: Detect go only if vendor includes go files
  • Loading branch information
xtreme-shane-lattanzio authored May 11, 2020
2 parents c14a6a8 + 0f8e609 commit 204798c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def active?
end

def go_files_exist?
!Dir[project_path.join('**/*.go')].empty?
!Dir[project_path.join('**/*.go')].empty? && !Dir[project_path.join('vendor/**/*.go')].empty?
end

def possible_package_paths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module LicenseFinder
FileUtils.touch File.join(project_path, 'main.go')
FileUtils.mkdir_p File.join(project_path, 'vendor', 'github.com', 'foo', 'bar')
FileUtils.mkdir_p File.join(project_path, 'vendor', 'golang.org', 'bar', 'baz')
FileUtils.touch File.join(project_path, 'vendor', 'github.com', 'foo', 'bar', 'utils.go')
end

it 'detects the project as go vendor project' do
Expand Down

0 comments on commit 204798c

Please sign in to comment.