Something went wrong. Try again.
Go bindings for libghostty-vt. pkg.go.dev/go.mitchellh.com/libghostty
ghostty
Something went wrong. Try again.
go-libghostty alloc_test.go
336 B · 13 lines
Go
at main
1234567891011121314package libghostty
import "testing"
func TestAllocZeroLength(t *testing.T) { // Empty allocations must cross cgo as nil, never as Zig's empty-slice // sentinel, which is not a valid pointer for Go's stack scanner. ptr := Alloc(0) defer Free(ptr, 0) if ptr != nil { t.Fatal("expected zero-length allocation to return nil") }}