Skip to content

Commit 284cc5c

Browse files
committed
Remove Go modules prepare command
Neither `go mod tidy` nor `go mod vendor` are necessary for Go modules to function properly. `go mod tidy` is a maintenance function for go.mod files and isn't necessary for graph evaluation. `go mod vendor` updates a vendor directory from the module cache, but if the vendor directory isn't present, Go will simply download dependencies to the module cache and evaluate the graph from there.
1 parent 56b3bec commit 284cc5c

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

lib/license_finder/package_managers/go_modules.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ def takes_priority_over
1212
end
1313
end
1414

15-
def prepare_command
16-
'GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor'
17-
end
18-
1915
def active?
2016
mod_files?
2117
end

spec/lib/license_finder/package_managers/go_modules_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ module LicenseFinder
7979
end
8080
end
8181

82-
describe '.prepare_command' do
83-
it 'returns the correct package management command' do
84-
expect(subject.prepare_command).to eq('GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor')
85-
end
86-
end
87-
8882
describe '.takes_priority_over' do
8983
it 'returns the package manager it takes priority over' do
9084
expect(described_class.takes_priority_over).to eq(Go15VendorExperiment)

0 commit comments

Comments
 (0)