Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@achew22
Last active November 2, 2017 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achew22/2680239539887d8d8661a9ab136b9b2d to your computer and use it in GitHub Desktop.
Save achew22/2680239539887d8d8661a9ab136b9b2d to your computer and use it in GitHub Desktop.
Demo for rules_go
bazel-bin
bazel-genfiles
bazel-out
bazel-rules_go_demo
bazel-testlogs

Demo for rules_go

load("@io_bazel_rules_go//go:def.bzl", "gazelle", "go_binary", "go_library")
gazelle(
name = "gazelle",
prefix = "github.com/example/project",
)
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/example/project",
visibility = ["//visibility:private"],
deps = ["@com_google_cloud_go//trace:go_default_library"],
)
go_binary(
name = "project",
importpath = "github.com/example/project",
library = ":go_default_library",
visibility = ["//visibility:public"],
)
package main
import (
"cloud.google.com/go/trace"
)
func main() {
_, _ = trace.NewClient(nil, "asdf")
}
http_archive(
name = "io_bazel_rules_go",
sha256 = "ba6feabc94a5d205013e70792accb6cce989169476668fbaf98ea9b342e13b59",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.6.0/rules_go-0.6.0.tar.gz",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains", "go_repository")
go_rules_dependencies()
go_register_toolchains()
load("@io_bazel_rules_go//go:def.bzl", "go_repository")
go_repository(
name = "com_google_cloud_go",
commit = "c070977cc61d0a6d9bf31484517ed2c164544cc0",
importpath = "github.com/GoogleCloudPlatform/google-cloud-go",
)
go_repository(
name = "org_golang_x_time",
commit = "6dc17368e09b0e8634d71cac8168d853e869a0c7",
importpath = "golang.org/x/time",
)
go_repository(
name = "org_golang_google_api",
commit = "75149eb4675e362b80c52d281a8df0d6aaf01dc6",
importpath = "google.golang.org/api",
)
go_repository(
name = "org_golang_x_oauth2",
commit = "bb50c06baba3d0c76f9d125c0719093e315b5b44",
importpath = "golang.org/x/oauth2",
)
go_repository(
name = "org_golang_x_sync",
commit = "8e0aa688b654ef28caa72506fa5ec8dba9fc7690",
importpath = "golang.org/x/sync",
)
@achew22
Copy link
Author

achew22 commented Nov 2, 2017

This was fixed by changing the import path to cloud.google.com/go for com_google_cloud_go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment