-
-
Save rsc/6f63d54886c9c50fa924597d7355bc93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_prefix") | |
go_prefix("rsc") | |
go_library( | |
name = "go_default_library", | |
srcs = ["hello.go"], | |
) | |
go_binary( | |
name = "hello", | |
library = ":go_default_library", | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@io_bazel_rules_go//go/private:toolchain.bzl", "go_sdk_repository", "go_repository_select") | |
load("@io_bazel_rules_go//go/private:repository_tools.bzl", "go_repository_tools") | |
load("@io_bazel_rules_go//go/private:go_repository.bzl", "go_repository") | |
def go_repositories(go_version = None): | |
go_sdk_repository( | |
name = "go1_8_3_linux_amd64", | |
url = "https://go-boringcrypto.storage.googleapis.com/go1.8.3b2.linux-amd64.tar.gz", | |
sha256 = "a453918b6ed0208748b2d6e0def31abf528d649d5cd8ecc5b21c4fd46eb38aa1", | |
strip_prefix = "go", | |
) | |
# Needed for gazelle and wtool | |
native.http_archive( | |
name = "com_github_bazelbuild_buildtools", | |
url = "https://codeload.github.com/bazelbuild/buildtools/zip/d5dcc29f2304aa28c29ecb8337d52bb9de908e0c", | |
strip_prefix = "buildtools-d5dcc29f2304aa28c29ecb8337d52bb9de908e0c", | |
type = "zip", | |
) | |
# Needed for fetch repo | |
go_repository( | |
name = "org_golang_x_tools", | |
importpath = "golang.org/x/tools", | |
urls = ["https://codeload.github.com/golang/tools/zip/3d92dd60033c312e3ae7cac319c792271cf67e37"], | |
strip_prefix = "tools-3d92dd60033c312e3ae7cac319c792271cf67e37", | |
type = "zip", | |
) | |
go_repository_select(name = "io_bazel_rules_go_toolchain", go_version = go_version) | |
go_repository_tools(name = "io_bazel_rules_go_repository_tools") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "runtime" | |
func main() { | |
println("hello from", runtime.Version()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_repository( | |
name = "io_bazel_rules_go", | |
remote = "https://github.com/bazelbuild/rules_go.git", | |
tag = "0.5.3", | |
) | |
load(":go-boringcrypto.bzl", "go_repositories") | |
go_repositories(go_version = "1.8.3") |
Author
rsc
commented
Aug 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment