Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaodice committed Jan 1, 2025
1 parent f8ac980 commit 5c8374f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/gocq/qsign.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func isServerAvailable(signServer string) bool {
case "ws", "wss":
return isWebSocketAvailable(signServer)
default:
log.Error("Unsupported protocol: %v", parsedURL.Scheme)
log.Errorf("Unsupported protocol: %v", parsedURL.Scheme)
return false
}
}
Expand All @@ -149,9 +149,7 @@ func isHTTPAvailable(url string) bool {
log.Warnf("HTTP check failed for %v, error: %v", url, err)
return false
}
defer func(Body io.ReadCloser) {
_ = Body.Close()
}(resp.Body)
_ = resp.Body.Close()

if resp.StatusCode == http.StatusOK {
// Assuming response body contains JSON with a "code" field
Expand All @@ -174,9 +172,7 @@ func isWebSocketAvailable(url string) bool {
log.Warnf("WebSocket check failed for %v, error: %v", url, err)
return false
}
defer func(conn *websocket.Conn) {
_ = conn.Close()
}(conn)
_ = conn.Close()

// Optionally, you can send a ping or some message to verify further

Expand Down

0 comments on commit 5c8374f

Please sign in to comment.