Use more idiomatic variable initialization for network/protocol
This commit is contained in:
parent
7a84d27dca
commit
f84b4b0f74
1 changed files with 2 additions and 5 deletions
7
app.go
7
app.go
|
@ -504,9 +504,8 @@ requests. We recommend supplying a valid host name.`)
|
||||||
err = http.ListenAndServeTLS(fmt.Sprintf("%s:443", bindAddress), app.cfg.Server.TLSCertPath, app.cfg.Server.TLSKeyPath, r)
|
err = http.ListenAndServeTLS(fmt.Sprintf("%s:443", bindAddress), app.cfg.Server.TLSCertPath, app.cfg.Server.TLSKeyPath, r)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var network string
|
network := "tcp"
|
||||||
var protocol string
|
protocol := "http"
|
||||||
|
|
||||||
if strings.HasPrefix(bindAddress, "/") {
|
if strings.HasPrefix(bindAddress, "/") {
|
||||||
network = "unix"
|
network = "unix"
|
||||||
protocol = "http+unix"
|
protocol = "http+unix"
|
||||||
|
@ -519,8 +518,6 @@ requests. We recommend supplying a valid host name.`)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
network = "tcp"
|
|
||||||
protocol = "http"
|
|
||||||
bindAddress = fmt.Sprintf("%s:%d", bindAddress, app.cfg.Server.Port)
|
bindAddress = fmt.Sprintf("%s:%d", bindAddress, app.cfg.Server.Port)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue