Skip to content

Commit

Permalink
Remove Go modules prepare command
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
miquella committed Jul 7, 2020
1 parent 56b3bec commit 284cc5c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions lib/license_finder/package_managers/go_modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ def takes_priority_over
end
end

def prepare_command
'GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor'
end

def active?
mod_files?
end
Expand Down
6 changes: 0 additions & 6 deletions spec/lib/license_finder/package_managers/go_modules_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ module LicenseFinder
end
end

describe '.prepare_command' do
it 'returns the correct package management command' do
expect(subject.prepare_command).to eq('GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor')
end
end

describe '.takes_priority_over' do
it 'returns the package manager it takes priority over' do
expect(described_class.takes_priority_over).to eq(Go15VendorExperiment)
Expand Down

0 comments on commit 284cc5c

Please sign in to comment.