Skip to content

Commit

Permalink
Merge pull request #12 from TristerosEmpire/duplicate-code
Browse files Browse the repository at this point in the history
Correcting a duplicate code
  • Loading branch information
simplesteph committed Jan 22, 2020
2 parents b81c709 + 6e91ffe commit cd2673c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions blog/blog_server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ func main() {
<-ch
// First we close the connection with MongoDB:
fmt.Println("Closing MongoDB Connection")
client.Disconnect(context.TODO())
// client.Disconnect(context.TODO())
if err := client.Disconnect(context.TODO()); err != nil {
log.Fatalf("Error on disconnection with MongoDB : %v", err)
}
// Second step : closing the listener
fmt.Println("Closing the listener")
if err := lis.Close(); err != nil {
log.Fatalf("Error on closing the listener : %v", err)
log.Fatalf("Error on disconnection with MongoDB : %v", err)
}
// Second step : closing the listener
fmt.Println("Closing the listener")
if err := lis.Close(); err != nil {
log.Fatalf("Error on closing the listener : %v", err)
}
// Finally, we stop the server
fmt.Println("Stopping the server")
s.Stop()
fmt.Println("End of Program")
s.Stop()
fmt.Println("End of Program")
}

0 comments on commit cd2673c

Please sign in to comment.