more lint driven refactoring

This commit is contained in:
evilsocket 2018-04-24 18:26:16 +02:00
commit 0de6f3a76e
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
57 changed files with 168 additions and 241 deletions

View file

@ -89,7 +89,7 @@ func (httpd *HttpServer) Configure() error {
var certFile string
var keyFile string
if httpd.Running() == true {
if httpd.Running() {
return session.ErrAlreadyStarted
}
@ -130,7 +130,7 @@ func (httpd *HttpServer) Configure() error {
}
if certFile != "" && keyFile != "" {
if core.Exists(certFile) == false || core.Exists(keyFile) == false {
if !core.Exists(certFile) || !core.Exists(keyFile) {
log.Info("Generating server TLS key to %s", keyFile)
log.Info("Generating server TLS certificate to %s", certFile)
if err := tls.Generate(certFile, keyFile); err != nil {
@ -155,7 +155,6 @@ func (httpd *HttpServer) Start() error {
return httpd.SetRunning(true, func() {
var err error
if httpd.isTLS() {
log.Info("HTTPS server starting on https://%s", httpd.server.Addr)
err = httpd.server.ListenAndServeTLS(httpd.certFile, httpd.keyFile)