From 0fd9164ab8480849e5dbee8f1e43c96ca43e7c8e Mon Sep 17 00:00:00 2001 From: Dmitry Korolev Date: Tue, 20 Aug 2024 20:01:19 +0300 Subject: [PATCH 1/3] fixed channel_max error message --- uri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uri.go b/uri.go index 4a148a3..d9ecf22 100644 --- a/uri.go +++ b/uri.go @@ -166,7 +166,7 @@ func ParseURI(uri string) (URI, error) { if params.Has("channel_max") { value, err := strconv.ParseUint(params.Get("channel_max"), 10, 16) if err != nil { - return builder, fmt.Errorf("connection_timeout is not an integer: %v", err) + return builder, fmt.Errorf("channel_max is not an uint16: %v", err) } builder.ChannelMax = uint16(value) } From 8868eb3a02ceb50a0bb1f22bc06023d7417856b1 Mon Sep 17 00:00:00 2001 From: Dmitry Korolev Date: Tue, 20 Aug 2024 20:02:27 +0300 Subject: [PATCH 2/3] fixed example "set client connection name" --- examples_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples_test.go b/examples_test.go index 81795a1..35e414b 100644 --- a/examples_test.go +++ b/examples_test.go @@ -428,7 +428,7 @@ func ExampleTable_SetClientConnectionName() { // name will be visible in RabbitMQ Management UI. config := amqp.Config{Properties: amqp.NewConnectionProperties()} config.Properties.SetClientConnectionName("my-client-app") - conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/") + conn, err := amqp.DialConfig("amqp://guest:guest@localhost:5672/", config) if err != nil { log.Fatalf("connection.open: %s", err) } From a7370c87a818a41720cc8e2a3a6944cfb63b6e05 Mon Sep 17 00:00:00 2001 From: Dmitry Korolev Date: Wed, 21 Aug 2024 08:42:18 +0300 Subject: [PATCH 3/3] fixed lint gosimple "should omit nil check; len()" --- write.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/write.go b/write.go index 3d15975..a65514d 100644 --- a/write.go +++ b/write.go @@ -96,7 +96,7 @@ func (f *headerFrame) write(w io.Writer) (err error) { if f.Properties.ContentEncoding != "" { mask |= flagContentEncoding } - if f.Properties.Headers != nil && len(f.Properties.Headers) > 0 { + if len(f.Properties.Headers) > 0 { mask |= flagHeaders } if f.Properties.DeliveryMode > 0 {