9ce21b5276
`zig cc` emits `--gc-sections` for the linker, which is incompatbile with what CGo thinks about linking. This commit adds a workaround: it will add `--no-gc-sections` to the linking step if the command is not specified (falling back to the default behavior of gcc/clang). Related: https://github.com/golang/go/issues/52690
14 lines
177 B
Go
14 lines
177 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestHello(t *testing.T) {
|
|
want := "hello, world"
|
|
got := Chello()
|
|
if got != want {
|
|
t.Errorf("expected %q, got %q", want, got)
|
|
}
|
|
}
|