Skip to content

Commit

Permalink
always defer close on port check
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousm4x committed Dec 17, 2023
1 parent 8d532a2 commit bc5e267
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/networking/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ func CheckPort(host string, port string) bool {
if err != nil {
return false
}
if conn != nil {
defer conn.Close()
return true
}
return false
defer conn.Close()
return conn != nil
}

0 comments on commit bc5e267

Please sign in to comment.