Created
February 21, 2014 19:47
-
-
Save rafrombrc/9142016 to your computer and use it in GitHub Desktop.
When nil != nil, or lolgo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code that's running: | |
outputError <- err | |
fmt.Println("t.connection (pre): ", t.connection) | |
if t.connection != nil { | |
fmt.Println("t.connection (post): ", t.connection) | |
fmt.Println("err: ", err) | |
t.connection.Close() | |
t.connection = nil | |
Output produced: | |
t.connection (pre): <nil> | |
t.connection (post): <nil> | |
err: dial tcp 127.0.0.1:5575: connection refused | |
panic: runtime error: invalid memory address or nil pointer dereference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment