chore: apply format and lint

This commit is contained in:
Adrien Raffin-Caboisse 2022-04-15 18:27:57 +02:00
parent cd1d10761f
commit 98f54c9f7f
No known key found for this signature in database
GPG key ID: 7FB60532DEBEAD6A
8 changed files with 51 additions and 18 deletions

View file

@ -107,7 +107,10 @@ func (h *Headscale) DERPHandler(ctx *gin.Context) {
hijacker, ok := ctx.Writer.(http.Hijacker)
if !ok {
log.Error().Caller().Msg("DERP requires Hijacker interface from Gin")
ctx.String(http.StatusInternalServerError, "HTTP does not support general TCP support")
ctx.String(
http.StatusInternalServerError,
"HTTP does not support general TCP support",
)
return
}
@ -115,7 +118,10 @@ func (h *Headscale) DERPHandler(ctx *gin.Context) {
netConn, conn, err := hijacker.Hijack()
if err != nil {
log.Error().Caller().Err(err).Msgf("Hijack failed")
ctx.String(http.StatusInternalServerError, "HTTP does not support general TCP support")
ctx.String(
http.StatusInternalServerError,
"HTTP does not support general TCP support",
)
return
}
@ -163,7 +169,10 @@ func (h *Headscale) DERPBootstrapDNSHandler(ctx *gin.Context) {
for _, node := range region.Nodes { // we don't care if we override some nodes
addrs, err := r.LookupIP(resolvCtx, "ip", node.HostName)
if err != nil {
log.Trace().Caller().Err(err).Msgf("bootstrap DNS lookup failed %q", node.HostName)
log.Trace().
Caller().
Err(err).
Msgf("bootstrap DNS lookup failed %q", node.HostName)
continue
}