79773219

Date: 2025-09-24 02:26:25
Score: 1.5
Natty:
Report link

I couldn't see I was checking session instead of err which inevitably would run log.Fatal

 session, err := client.NewSession()
    if session != nil {
        log.Fatalf("Unable to create a session %v", err)
    }

My code should have actually check err instead like this:

 session, err := client.NewSession()
    if err != nil {
        log.Fatalf("Unable to create a session %v", err)
    }

The credit for this answer goes to @Mr_Pink

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Mr_Pink
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: wavesinaroom