Skip to content

Instantly share code, notes, and snippets.

@rustyeddy
Last active April 6, 2022 20:44
Show Gist options
  • Save rustyeddy/6007c0073146f08d9d905b882bb6ef8d to your computer and use it in GitHub Desktop.
Save rustyeddy/6007c0073146f08d9d905b882bb6ef8d to your computer and use it in GitHub Desktop.
package main
import (
"flag"
"log"
)
type Configuration struct {
Broker string `json:"broker"`
Addr string `json:"Addr"
}
var (
config Configuration
)
func init() {
flag.StringVar(&config.Broker, "broker", "tcp://localhost:1883", "Address of MQTT broker")
flag.BoolVar(&config.Debug, "debug", false, "Start debugging")
flag.BoolVar(&config.DebugMQTT, "debug-mqtt", false, "Debugging MQTT messages")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment