Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
0.9.1
-
None
-
Patch Available
Description
The error handling at LoadX509KeyPair() is still incorrect, it may now throw a Panic instead of reporting the error.
Main reason is a slight scoping issue. If I read http://golang.org/doc/effective_go.html#redeclaration correctly, then
var err error if foo, err := loadFoo(); err == nil { doSomething() } if err != nil { return err }
is not the same as
var err error foo, err := loadFoo() if err == nil { doSomething() } if err != nil { return err }
because in the latter case a reassignment happens, while in the former case another, second err variable is declared. Therefore, in the first case the error check after the if may incorrectly report successful execution.
Attachments
Attachments
Issue Links
- relates to
-
THRIFT-2109 Secure connections should be supported in Go
- Closed