This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 839cdee1c091eacce7e2c91b6f60f205669a5521
Author: Andrew Stitcher <[email protected]>
AuthorDate: Wed Jun 1 20:38:46 2022 -0400

    PROTON-2557: Go change for introduction of pn_tostring
---
 go/pkg/proton/wrappers.go | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/go/pkg/proton/wrappers.go b/go/pkg/proton/wrappers.go
index 724f6934b..467d94480 100644
--- a/go/pkg/proton/wrappers.go
+++ b/go/pkg/proton/wrappers.go
@@ -126,10 +126,9 @@ func (d Data) Error() error         { return 
PnError(C.pn_data_error(d.pn)) }
 func (d Data) Empty() bool          { return C.pn_data_size(d.pn) == 0 }
 
 func (d Data) String() string {
-       str := C.pn_string(C.CString(""))
-       defer C.pn_free(unsafe.Pointer(str))
-       C.pn_inspect(unsafe.Pointer(d.pn), str)
-       return C.GoString(C.pn_string_get(str))
+       str := C.pn_tostring(unsafe.Pointer(d.pn))
+       defer C.free(unsafe.Pointer(str))
+       return C.GoString(str)
 }
 
 // Unmarshal the value of d into value pointed at by ptr, see amqp.Unmarshal() 
for details


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to