Registry /
messaging / eclipse-paho-mqtt-golang
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
mqtt
✓ github.com/eclipse/paho.mqtt.golang
Connect to an MQTT broker
package main
import (
"fmt"
mqtt "github.com/eclipse/paho.mqtt.golang"
)
func main() {
opts := mqtt.NewClientOptions().AddBroker("tcp://broker.hivemq.com:1883")
client := mqtt.NewClient(opts)
if token := client.Connect(); token.Wait() && token.Error() != nil {
fmt.Println(token.Error())
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.5.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.