diff --git a/bindings/c/tests/bdd.cpp b/bindings/c/tests/bdd.cpp index 246dbfda1caf..1aa37f5b3e06 100644 --- a/bindings/c/tests/bdd.cpp +++ b/bindings/c/tests/bdd.cpp @@ -61,7 +61,7 @@ TEST_F(OpendalBddTest, FeatureTest) .data = (uint8_t*)this->content.c_str(), .len = this->content.length(), }; - opendal_error* error = opendal_operator_write(this->p, this->path.c_str(), data); + opendal_error* error = opendal_operator_write(this->p, this->path.c_str(), &data); EXPECT_EQ(error, nullptr); // The blocking file "test" should exist @@ -99,7 +99,7 @@ TEST_F(OpendalBddTest, FeatureTest) opendal_result_operator_writer writer = opendal_operator_writer(this->p, this->path.c_str()); EXPECT_EQ(writer.error, nullptr); - opendal_result_writer_write w = opendal_writer_write(writer.writer, data); + opendal_result_writer_write w = opendal_writer_write(writer.writer, &data); EXPECT_EQ(w.error, nullptr); EXPECT_EQ(w.size, this->content.length()); opendal_writer_free(writer.writer); diff --git a/bindings/c/tests/list.cpp b/bindings/c/tests/list.cpp index d4e31cf79e5b..3b64fef460b6 100644 --- a/bindings/c/tests/list.cpp +++ b/bindings/c/tests/list.cpp @@ -65,7 +65,7 @@ TEST_F(OpendalListTest, ListDirTest) }; // write must succeed - EXPECT_EQ(opendal_operator_write(this->p, path.c_str(), data), + EXPECT_EQ(opendal_operator_write(this->p, path.c_str(), &data), nullptr); // list must succeed since the write succeeded diff --git a/bindings/go/operator.go b/bindings/go/operator.go index be5c50f2c750..807bcc6908fe 100644 --- a/bindings/go/operator.go +++ b/bindings/go/operator.go @@ -287,10 +287,10 @@ var withBytesFree = withFFI(ffiOpts{ rType: &ffi.TypeVoid, aTypes: []*ffi.Type{&typeBytes}, }, func(_ context.Context, ffiCall func(rValue unsafe.Pointer, aValues ...unsafe.Pointer)) bytesFree { - return func(b opendalBytes) { + return func(b *opendalBytes) { ffiCall( nil, - b, + unsafe.Pointer(&b), ) } })