Skip to content

Commit

Permalink
Switch to http archive when downloading go package
Browse files Browse the repository at this point in the history
  • Loading branch information
rosun82 authored and Mican Zhang committed Jan 8, 2020
1 parent db70f7b commit 27859a2
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions build_rules/github.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,7 @@ def github_new_http_archive(name, package, build_file = None, build_file_content
build_file_content = build_file_content,
)

def github_go_repository(
name,
package,
importpath = "",
commit = None,
tag = None,
mirror_urls = [],
**kwargs):
def github_go_repository(name, package, importpath = "", commit, tag, sha256 = "", mirror_urls = [], **kwargs):
"""Adding go repository from github and convert it to bazel repository.
Note that for now the dependencies will not be pulled in automatically. You
Expand All @@ -94,16 +87,16 @@ def github_go_repository(
github.com/Shopify/sarama.
commit: (string) Commit number.
tag: (string) Commit tag. Exactly one of commit or tag is required.
importpath: (string) Optionally override the import path.
sha256: (string) Optional checksum.
mirror_urls: (list of string) Optional list of mirror URLs. This does not
have to include the github URL.
"""
remote = "https://github.com/" + package
if importpath == "":
importpath = "github.com/" + package
return go_repository(
name = name,
importpath = importpath,
urls = [_github_tar_gz_url(package, commit, tag)] + mirror_urls,
strip_prefix = _tar_gz_prefix(package, commit, tag),
sha256 = sha256,
**kwargs
)

0 comments on commit 27859a2

Please sign in to comment.