-
-
Save mikedanese/81c14e6e202084f3370034a2f5649191 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
3.7.1 |
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
bazel-* |
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_library", "go_test") | |
go_library( | |
name = "go_default_library", | |
srcs = ["foo.go"], | |
importpath = "k8s.io/kubernetes/scratch/foo", | |
visibility = ["//visibility:public"], | |
) | |
go_test( | |
name = "go_default_test", | |
srcs = ["foo_test.go"], | |
embed = [":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
package foo |
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 foo | |
import ( | |
"io/ioutil" | |
"net" | |
"path/filepath" | |
"testing" | |
) | |
func TestFoo(t *testing.T) { | |
socketDir, err := ioutil.TempDir("", "device_plugin") | |
if err != nil { | |
t.Fatal(err) | |
} | |
socketPath := filepath.Join(socketDir, "test.sock") | |
t.Logf("socket path: %s", socketPath) | |
l, err := net.Listen("unix", socketPath) | |
if err != nil { | |
t.Fatalf("listen error: %s", err) | |
} | |
defer l.Close() | |
} |
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("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
http_archive( | |
name = "io_bazel_rules_go", | |
sha256 = "7904dbecbaffd068651916dce77ff3437679f9d20e1a7956bff43826e7645fcc", | |
urls = [ | |
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz", | |
"https://github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz", | |
], | |
) | |
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | |
go_rules_dependencies() | |
go_register_toolchains(version = "1.15.6") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment