Skip to content

Instantly share code, notes, and snippets.

@jayconrod
Created March 28, 2018 20:34
Show Gist options
  • Save jayconrod/f89c849ed80421a8e4b0fabb633e15e8 to your computer and use it in GitHub Desktop.
Save jayconrod/f89c849ed80421a8e4b0fabb633e15e8 to your computer and use it in GitHub Desktop.
tiny coverage example
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
# gazelle:prefix example.com/repo
load("@bazel_gazelle//:def.bzl", "gazelle")
gazelle(name = "gazelle")
go_library(
name = "go_default_library",
srcs = ["lib.go"],
importpath = "example.com/repo",
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
srcs = ["lib_test.go"],
embed = [":go_default_library"],
)
package lib
func Live() int {
return 12
}
func Dead() int {
return 34
}
package lib
import (
"testing"
)
func TestLive(t *testing.T) {
Live()
}
@pylipp
Copy link

pylipp commented Jan 17, 2019

What's the command to run the coverage?

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