MCPcopy Create free account
hub / github.com/golang/mobile / writeTempFile

Function writeTempFile

bind/bind_test.go:127–139  ·  view source on GitHub ↗
(t *testing.T, name string, contents []byte)

Source from the content-addressed store, hash-verified

125}
126
127func writeTempFile(t *testing.T, name string, contents []byte) string {
128 f, err := os.CreateTemp("", name)
129 if err != nil {
130 t.Fatal(err)
131 }
132 if _, err := f.Write(contents); err != nil {
133 t.Fatal(err)
134 }
135 if err := f.Close(); err != nil {
136 t.Fatal(err)
137 }
138 return f.Name()
139}
140
141func TestGenObjc(t *testing.T) {
142 for _, filename := range tests {

Callers 4

TestGenObjcFunction · 0.70
TestGenJavaFunction · 0.70
testGenGoFunction · 0.70
TestCustomPrefixFunction · 0.70

Calls 2

WriteMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected