Skip to content

Commit

Permalink
Go15VendorExperiment: Detect go only if vendor includes go files
Browse files Browse the repository at this point in the history
  • Loading branch information
forelabs committed May 11, 2020
1 parent 99c97da commit 0f8e609
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 0f8e609

Please sign in to comment.