aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/language/go.rb
blob: 90922ddb74034524a4e246206b26f4aa5387d015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "resource"

module Language
  module Go
    # Given a set of resources, stages them to a gopath for
    # building go software.
    # The resource names should be the import name of the package,
    # e.g. `resource "github.com/foo/bar"`
    def self.stage_deps(resources, target)
      if resources.empty?
        if ARGV.homebrew_developer?
          odie "tried to stage empty Language::Go resources array"
        else
          opoo "tried to stage empty Language::Go resources array"
        end
      end
      resources.grep(Resource::Go) { |resource| resource.stage(target) }
    end
  end
end