Move flag code out of init into main.

This commit is contained in:
David Fifield 2017-07-14 20:00:25 -07:00
parent 3f4f5d2292
commit eaa82b8f9a

View file

@ -229,9 +229,9 @@ func ipHandler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(remoteAddr))
}
func main() {
var cert, cert_key, http_port, https_port string
func init() {
flag.StringVar(&cert, "cert", "", "TLS certificate file")
flag.StringVar(&cert_key, "key", "", "TLS key file")
@ -250,9 +250,6 @@ func init() {
log.Println("Using cert file:", cert)
log.Println("Using cert key file: ", cert_key)
}
func main() {
ctx := NewBrokerContext()