From 0f6e4b2cb1ee5913ca6c98bf5dd778328a8912a2 Mon Sep 17 00:00:00 2001 From: Emma Sax Date: Fri, 27 Sep 2024 16:51:27 -0500 Subject: [PATCH] Add `-buildvcs=false` to the `go list` command --- lib/license_finder/package_managers/go_modules.rb | 2 +- spec/lib/license_finder/package_managers/go_modules_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/license_finder/package_managers/go_modules.rb b/lib/license_finder/package_managers/go_modules.rb index 68422e0c2..840487232 100644 --- a/lib/license_finder/package_managers/go_modules.rb +++ b/lib/license_finder/package_managers/go_modules.rb @@ -57,7 +57,7 @@ def packages_info # TODO: Figure out a way to make the vendor directory work (i.e. remove the # -mod=readonly flag). Each of the imported packages gets listed separatly, # confusing the issue as to which package is the root of the module. - go_list_cmd = "GO111MODULE=on go list -mod=readonly -deps -f '#{format_str}' ./..." + go_list_cmd = "GO111MODULE=on go list -mod=readonly -buildvcs=false -deps -f '#{format_str}' ./..." info_output, stderr, status = Cmd.run(go_list_cmd) log_errors_with_cmd(go_list_cmd, "Getting the dependencies from go list failed \n\t#{stderr}") unless status.success? raise "Command '#{go_list_cmd}' failed to execute" unless status.success? diff --git a/spec/lib/license_finder/package_managers/go_modules_spec.rb b/spec/lib/license_finder/package_managers/go_modules_spec.rb index 36e7387dc..6c135280e 100644 --- a/spec/lib/license_finder/package_managers/go_modules_spec.rb +++ b/spec/lib/license_finder/package_managers/go_modules_spec.rb @@ -22,7 +22,7 @@ module LicenseFinder subject { GoModules.new(project_path: Pathname(src_path), logger: logger, log_directory: 'some-directory') } describe '#current_packages' do - let(:go_list_cmd) { "GO111MODULE=on go list -mod=readonly -deps -f '#{go_list_format}' ./..." } + let(:go_list_cmd) { "GO111MODULE=on go list -mod=readonly -buildvcs=false -deps -f '#{go_list_format}' ./..." } before do FakeFS.activate!