eclipse-paho / paho.mqtt.golang

Other
2.77k stars 534 forks source link

Would you like to tell me how to delete retained message #549

Closed roooneychina closed 2 years ago

roooneychina commented 3 years ago

topic := "....." ,type Spacex struct{ } var structxx2 Spacex structxx3,_ := json.Marshal(structxx2)

Publish(topic, 1, true, structxx3)

it seems does not work. would you like to help me?

roooneychina commented 3 years ago

var xxx [] byte

Publish("topic", 1, true, xxx) is that ok? many thanks

MattBrittan commented 3 years ago

Just send a 0 byte message - there is an example in the tests.

Note: Please use this section for reporting issues; not asking general questions (stack overflow is a better place for that).

MattBrittan commented 2 years ago

Closing this as it's a question that I believe I have answered,