gitlab-org--gitlab-foss/app/finders/packages/go/package_finder.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
570 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Packages
module Go
class PackageFinder
delegate :exists?, to: :candidates
def initialize(project, module_name, module_version)
@project = project
@module_name = module_name
@module_version = module_version
end
def execute
candidates.first
end
private
def candidates
@project
.packages
.golang
.installable
.with_name(@module_name)
.with_version(@module_version)
end
end
end
end