diff --git a/go/genwrap.go b/go/genwrap.go index b9a8201656..27a5f7e6d4 100644 --- a/go/genwrap.go +++ b/go/genwrap.go @@ -94,7 +94,7 @@ package amqp // #include // #if PN_VERSION_MAJOR == %s && PN_VERSION_MINOR < %s -// #error module github.com/apache/qpid-proton requires Proton-C library version 0.10 or greater +// #error packages qpid.apache.org/... require Proton-C library version 0.10 or greater // #endif import "C" `, splitVersion[0], splitVersion[1]) @@ -352,15 +352,15 @@ func mapType(ctype string) (g genType) { case "C.int64_t": g.Gotype = "int64" case "C.int32_t": - g.Gotype = "int16" - case "C.int16_t": g.Gotype = "int32" + case "C.int16_t": + g.Gotype = "int16" case "C.uint64_t": g.Gotype = "uint64" case "C.uint32_t": - g.Gotype = "uint16" - case "C.uint16_t": g.Gotype = "uint32" + case "C.uint16_t": + g.Gotype = "uint16" case "C.const char *": fallthrough case "C.char *": diff --git a/go/pkg/amqp/url_test.go b/go/pkg/amqp/url_test.go index 192e2fb04e..c13a8b57bc 100644 --- a/go/pkg/amqp/url_test.go +++ b/go/pkg/amqp/url_test.go @@ -32,8 +32,9 @@ func ExampleParseURL() { "amqps://host", "/path", "", - ":1234", - // Taken out because the go 1.4 URL parser isn't the same as later + // Taken out because url.Parse error formatting changed in 1.13 + // ":1234", + // Taken out because the go 1.4 URL parser isn't the same as later //"[::1]", //"[::1", // Output would be: @@ -55,5 +56,4 @@ func ExampleParseURL() { // amqps://host:amqps // amqp://localhost:amqp/path // amqp://localhost:amqp - // parse :1234: missing protocol scheme } diff --git a/go/pkg/amqp/version.go b/go/pkg/amqp/version.go index f770d08da7..31d69d2f25 100644 --- a/go/pkg/amqp/version.go +++ b/go/pkg/amqp/version.go @@ -22,16 +22,14 @@ under the License. // Update the generator and re-run if you need to modify this code. // + package amqp -// Version check for compatible proton-c library. -// -// NOTE: the required version should NOT be increased unless the Go -// library is modified to require some new proton-c API. That hasn't -// happened for a long time. +// Version check for proton library. +// Done here because this is the lowest-level dependency for all the proton Go packages. // #include -// #if PN_VERSION_MAJOR == 0 && PN_VERSION_MINOR < 10 +// #if PN_VERSION_MAJOR == 0 && PN_VERSION_MINOR < 27 // #error packages qpid.apache.org/... require Proton-C library version 0.10 or greater // #endif import "C" diff --git a/go/pkg/proton/wrappers_gen.go b/go/pkg/proton/wrappers_gen.go index a627e60f8f..b77139d1d2 100644 --- a/go/pkg/proton/wrappers_gen.go +++ b/go/pkg/proton/wrappers_gen.go @@ -467,10 +467,10 @@ func (d Disposition) Condition() Condition { func (d Disposition) Data() Data { return Data{C.pn_disposition_data(d.pn)} } -func (d Disposition) SectionNumber() uint16 { - return uint16(C.pn_disposition_get_section_number(d.pn)) +func (d Disposition) SectionNumber() uint32 { + return uint32(C.pn_disposition_get_section_number(d.pn)) } -func (d Disposition) SetSectionNumber(section_number uint16) { +func (d Disposition) SetSectionNumber(section_number uint32) { C.pn_disposition_set_section_number(d.pn, C.uint32_t(section_number)) } func (d Disposition) SectionOffset() uint64 { @@ -828,23 +828,23 @@ func (t Transport) Log(message string) { C.pn_transport_log(t.pn, messageC) } -func (t Transport) ChannelMax() uint32 { - return uint32(C.pn_transport_get_channel_max(t.pn)) +func (t Transport) ChannelMax() uint16 { + return uint16(C.pn_transport_get_channel_max(t.pn)) } -func (t Transport) SetChannelMax(channel_max uint32) int { +func (t Transport) SetChannelMax(channel_max uint16) int { return int(C.pn_transport_set_channel_max(t.pn, C.uint16_t(channel_max))) } -func (t Transport) RemoteChannelMax() uint32 { - return uint32(C.pn_transport_remote_channel_max(t.pn)) +func (t Transport) RemoteChannelMax() uint16 { + return uint16(C.pn_transport_remote_channel_max(t.pn)) } -func (t Transport) MaxFrame() uint16 { - return uint16(C.pn_transport_get_max_frame(t.pn)) +func (t Transport) MaxFrame() uint32 { + return uint32(C.pn_transport_get_max_frame(t.pn)) } -func (t Transport) SetMaxFrame(size uint16) { +func (t Transport) SetMaxFrame(size uint32) { C.pn_transport_set_max_frame(t.pn, C.uint32_t(size)) } -func (t Transport) RemoteMaxFrame() uint16 { - return uint16(C.pn_transport_get_remote_max_frame(t.pn)) +func (t Transport) RemoteMaxFrame() uint32 { + return uint32(C.pn_transport_get_remote_max_frame(t.pn)) } func (t Transport) IdleTimeout() time.Duration { return (time.Duration(C.pn_transport_get_idle_timeout(t.pn)) * time.Millisecond)