Skip to content

Commit

Permalink
[Changed] Remove +compatible in Go package versions [#171754392]
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Jun <jjun@pivotal.io>
  • Loading branch information
pivotal-pmital authored and Jeff Jun committed Apr 23, 2020
1 parent e9dca96 commit 5cba580
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/license_finder/packages/go_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def from_dependency(hash, prefix, full_version)
name = hash['ImportPath']
install_path = hash['InstallPath']
install_path ||= install_path(prefix.join(name))
version = full_version ? hash['Rev'] : hash['Rev'][0..6]
version = full_version ? hash['Rev'].gsub('+incompatible', '') : hash['Rev'][0..6]
homepage = hash['Homepage']
new(name, version, install_path: install_path, package_manager: 'Go', homepage: homepage)
end
Expand Down
11 changes: 11 additions & 0 deletions spec/lib/license_finder/package_managers/go_package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,16 @@ module LicenseFinder

its(:install_path) { should == '/Go/vendor/src/github.com/pivotal/spec_name' }
end

context 'when the version includes +incompatible string' do
let(:options) do
{
'ImportPath' => 'github.com/pivotal/spec_name',
'Rev' => '4326c3435332d06b410a2672d28d1343c4059fae+incompatible'
}
end

its(:version) { should == '4326c3435332d06b410a2672d28d1343c4059fae' }
end
end
end

0 comments on commit 5cba580

Please sign in to comment.