Repository: eclipse-paho/paho.golang

Issue:
make build issue
**Describe the bug**
make build action has some error
**To reproduce**
make build
**Debug output**
root@localhost:/data/paho.golang# make build
go build -o ./bin/chat ./paho/cmd/chat
go build -o ./bin/rpc ./paho/cmd/rpc
go build -o ./bin/stdinpub ./paho/cmd/stdinpub
go build -o ./bin/stdoutsub ./paho/cmd/stdoutsub
go build -o ./bin/rpc_auto ./autopaho/cmd/rpc
stat /data/paho.golang/autopaho/cmd/rpc: directory not found
make: *** [Makefile:31: build_rpc_cm] Error 1

**Expected behaviour**
there are no errors

**Software used:**
go version go1.23.7 linux/amd64

**Additional context**
none


Hints from issue comments:
@hiproz: it is a simple path issue ,i will fix it@hiproz: Close #296 @MattBrittan: Belive the PR (merger May 4) resolved this so closing the issue (plase feel free to reopen if not resolved).

Solution patch:
diff --git a/Makefile b/Makefile
index 72de33a..ba3c71d 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ build_rpc:
 	go build -o ./bin/rpc ./paho/cmd/rpc
 
 build_rpc_cm:
-	go build -o ./bin/rpc_auto ./autopaho/cmd/rpc
+	go build -o ./bin/rpc_auto ./autopaho/examples/rpc
 
 build_pub:
 	go build -o ./bin/stdinpub ./paho/cmd/stdinpub
diff --git a/packets/subscribe.go b/packets/subscribe.go
index c179e4e..c0881f2 100644
--- a/packets/subscribe.go
+++ b/packets/subscribe.go
@@ -52,6 +52,12 @@ func (s *Subscribe) Type() byte {
 	return SUBSCRIBE
 }
 
+const (
+	RetainSendOnSubscribe      = iota // on any successful subscribe request
+	RetainSendOnSubscribeIfNew        // only if the subscribe request is new
+	RetainDoNotSend                   // never send retained messages
+)
+
 // SubOptions is the struct representing the options for a subscription
 type SubOptions struct {
 	Topic             string



Test patch:
diff --git a/packets/subscribe_test.go b/packets/subscribe_test.go
index b5bcfab..c002049 100644
--- a/packets/subscribe_test.go
+++ b/packets/subscribe_test.go
@@ -38,14 +38,14 @@ func TestSubscribePackUnpack(t *testing.T) {
 					{
 						Topic:             "a/b",
 						QoS:               1,
-						RetainHandling:    0,
+						RetainHandling:    RetainSendOnSubscribe,
 						NoLocal:           false,
 						RetainAsPublished: false,
 					},
 					{
 						Topic:             "c/d",
 						QoS:               2,
-						RetainHandling:    0,
+						RetainHandling:    RetainSendOnSubscribe,
 						NoLocal:           false,
 						RetainAsPublished: false,
 					}},
@@ -61,7 +61,7 @@ func TestSubscribePackUnpack(t *testing.T) {
 					{
 						Topic:             "NoLocal",
 						QoS:               0,
-						RetainHandling:    0,
+						RetainHandling:    RetainSendOnSubscribe,
 						NoLocal:           true,
 						RetainAsPublished: false,
 					},
@@ -78,7 +78,7 @@ func TestSubscribePackUnpack(t *testing.T) {
 					{
 						Topic:             "RAP",
 						QoS:               0,
-						RetainHandling:    0,
+						RetainHandling:    RetainSendOnSubscribe,
 						NoLocal:           false,
 						RetainAsPublished: true,
 					},
@@ -95,21 +95,21 @@ func TestSubscribePackUnpack(t *testing.T) {
 					{
 						Topic:             "Retain0",
 						QoS:               0,
-						RetainHandling:    0,
+						RetainHandling:    RetainSendOnSubscribe,
 						NoLocal:           false,
 						RetainAsPublished: false,
 					},
 					{
 						Topic:             "Retain1",
 						QoS:               0,
-						RetainHandling:    1,
+						RetainHandling:    RetainSendOnSubscribeIfNew,
 						NoLocal:           false,
 						RetainAsPublished: false,
 					},
 					{
 						Topic:             "Retain2",
 						QoS:               0,
-						RetainHandling:    2,
+						RetainHandling:    RetainDoNotSend,
 						NoLocal:           false,
 						RetainAsPublished: false,
 					},