From b7e186b370be862479c73bda6e0035eb2a809278 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 7 Jun 2016 07:33:11 +0000 Subject: [PATCH] cmd/discosrv: Fix lint warnings GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3275 --- cmd/discosrv/main.go | 6 +++--- cmd/discosrv/querysrv.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/discosrv/main.go b/cmd/discosrv/main.go index 7dfea1173..16f0623e7 100644 --- a/cmd/discosrv/main.go +++ b/cmd/discosrv/main.go @@ -52,7 +52,7 @@ var ( certFile = "cert.pem" keyFile = "key.pem" debug = false - useHttp = false + useHTTP = false ) func main() { @@ -76,14 +76,14 @@ func main() { flag.StringVar(&certFile, "cert", certFile, "Certificate file") flag.StringVar(&keyFile, "key", keyFile, "Key file") flag.BoolVar(&debug, "debug", debug, "Debug") - flag.BoolVar(&useHttp, "http", useHttp, "Listen on HTTP (behind an HTTPS proxy)") + flag.BoolVar(&useHTTP, "http", useHTTP, "Listen on HTTP (behind an HTTPS proxy)") flag.Parse() log.Println(LongVersion) var cert tls.Certificate var err error - if !useHttp { + if !useHTTP { cert, err = tls.LoadX509KeyPair(certFile, keyFile) if err != nil { log.Fatalln("Failed to load X509 key pair:", err) diff --git a/cmd/discosrv/querysrv.go b/cmd/discosrv/querysrv.go index d1d4f3d56..6d55be79d 100644 --- a/cmd/discosrv/querysrv.go +++ b/cmd/discosrv/querysrv.go @@ -83,7 +83,7 @@ func (s *querysrv) Serve() { Cache: lru.New(lruSize), } - if useHttp { + if useHTTP { listener, err := net.Listen("tcp", s.addr) if err != nil { log.Println("Listen:", err) @@ -153,7 +153,7 @@ func (s *querysrv) handler(w http.ResponseWriter, req *http.Request) { }() var remoteIP net.IP - if useHttp { + if useHTTP { remoteIP = net.ParseIP(req.Header.Get("X-Forwarded-For")) } else { addr, err := net.ResolveTCPAddr("tcp", req.RemoteAddr)