[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Move flag code out of init into main.



commit eaa82b8f9a0d3bafe32062ececbd4f8473bfcf86
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Fri Jul 14 20:00:25 2017 -0700

    Move flag code out of init into main.
---
 broker/broker.go | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/broker/broker.go b/broker/broker.go
index ee6f509..e3aecb1 100644
--- a/broker/broker.go
+++ b/broker/broker.go
@@ -229,9 +229,9 @@ func ipHandler(w http.ResponseWriter, r *http.Request) {
 	w.Write([]byte(remoteAddr))
 }
 
-var cert, cert_key, http_port, https_port string
+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()
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits