1

rename/fix the package

This commit is contained in:
Motiejus Jakštys
2022-01-28 15:57:22 +02:00
parent f19927ac17
commit 1cd04478b7
6 changed files with 18 additions and 11 deletions

View File

@@ -7,18 +7,25 @@ go_library(
cgo = True,
importpath = "github.com/motiejus/bazel-zig-cc/test",
visibility = ["//visibility:private"],
deps = ["@com_github_mattn_go_sqlite3//:go-sqlite3"],
)
go_binary(
name = "hello",
embed = [":hello_lib"],
embed = [":test_lib"],
static = "on",
visibility = ["//visibility:public"],
)
go_test(
name = "hello_test",
name = "test_test",
srcs = ["hello_test.go"],
embed = [":hello_lib"],
embed = [":test_lib"],
)
go_library(
name = "test_lib",
srcs = ["hello.go"],
cgo = True,
importpath = "git.sr.ht/~motiejus/bazel-zig-cc/test",
visibility = ["//visibility:private"],
)

View File

@@ -9,6 +9,6 @@ func main() {
C.printhello()
}
func chello() string {
func Chello() string {
return C.GoString(C.hello())
}

View File

@@ -1,10 +1,12 @@
package main
import "testing"
import (
"testing"
)
func TestHello(t *testing.T) {
want := "hello, world"
got := chello()
got := Chello()
if got != want {
t.Errorf("expected %q, got %q", want, got)
}