add a client to use cubby in go projects

This commit is contained in:
juancwu 2026-04-29 12:36:08 +00:00
commit 699aa30b07
4 changed files with 524 additions and 0 deletions

20
testhelpers_test.go Normal file
View file

@ -0,0 +1,20 @@
package cubby
import (
"os/exec"
"testing"
)
func runCmd(t *testing.T, name string, args ...string) ([]byte, error) {
t.Helper()
return exec.Command(name, args...).CombinedOutput()
}
func startCmd(t *testing.T, name string, args ...string) *exec.Cmd {
t.Helper()
cmd := exec.Command(name, args...)
if err := cmd.Start(); err != nil {
t.Fatalf("start %s: %v", name, err)
}
return cmd
}