Remove redundant loggers and clean up logic

pull/3375/head
gunnaraasen 2015-07-23 15:01:48 -07:00
parent 54c4066a5f
commit b30351f750
1 changed files with 1 additions and 6 deletions

View File

@ -47,7 +47,6 @@ func (s *Service) Open() error {
if s.https {
cert, err := tls.LoadX509KeyPair(s.cert, s.cert)
if err != nil {
s.Logger.Printf("Failed to load HTTPS certificate '%s': %s", s.cert, err)
return err
}
@ -55,16 +54,12 @@ func (s *Service) Open() error {
Certificates: []tls.Certificate{cert},
})
if err != nil {
s.Logger.Printf("Failed to bind HTTPS on %s: %s", s.addr, err)
return err
}
s.Logger.Println("listening on HTTPS:", listener.Addr().String())
s.ln = listener
}
// Assume that the HTTPS configuration failed
if s.ln == nil {
} else {
listener, err := net.Listen("tcp", s.addr)
if err != nil {
return err