Skip to content

Instantly share code, notes, and snippets.

@cgbystrom
Created November 9, 2017 20:08
Show Gist options
  • Save cgbystrom/6973b478e23286604c80c506b216a9b3 to your computer and use it in GitHub Desktop.
Save cgbystrom/6973b478e23286604c80c506b216a9b3 to your computer and use it in GitHub Desktop.
Minimal Go app built with Bazel
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//go:def.bzl", "go_prefix", "go_binary")
go_prefix("helloworld")
go_binary(
name = "helloworld",
srcs = ["helloworld.go"],
)
package main
func main() {
println("Hello!")
}
http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.7.0/rules_go-0.7.0.tar.gz",
sha256 = "91fca9cf860a1476abdc185a5f675b641b60d3acf0596679a27b580af60bf19c",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment