diff options
author | Samuel Stauffer <samuel@descolada.com> | 2014-03-19 22:22:55 +0100 |
---|---|---|
committer | Samuel Stauffer <samuel@descolada.com> | 2014-03-19 22:22:55 +0100 |
commit | 2eea0c0a703e32b904741d52c9e2c9ae836c14b0 (patch) | |
tree | 10820142494033c3d3297249ab31efe0176aec77 /ldap.go | |
parent | Short writes don't happen without an error so don't loop (diff) | |
download | ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.tar ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.tar.gz ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.tar.bz2 ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.tar.lz ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.tar.xz ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.tar.zst ldap-2eea0c0a703e32b904741d52c9e2c9ae836c14b0.zip |
Diffstat (limited to 'ldap.go')
-rw-r--r-- | ldap.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -150,7 +150,7 @@ var LDAPResultCodeMap = map[uint8]string{ } // Adds descriptions to an LDAP Response packet for debugging -func addLDAPDescriptions(packet *ber.Packet) (err *Error) { +func addLDAPDescriptions(packet *ber.Packet) (err error) { defer func() { if r := recover(); r != nil { err = NewError(ErrorDebugging, errors.New("ldap: cannot process packet to add descriptions")) @@ -264,7 +264,7 @@ func addDefaultLDAPResponseDescriptions(packet *ber.Packet) { } } -func DebugBinaryFile(FileName string) *Error { +func DebugBinaryFile(FileName string) error { file, err := ioutil.ReadFile(FileName) if err != nil { return NewError(ErrorDebugging, err) @@ -282,11 +282,11 @@ type Error struct { ResultCode uint8 } -func (e *Error) String() string { +func (e *Error) Error() string { return fmt.Sprintf("LDAP Result Code %d %q: %s", e.ResultCode, LDAPResultCodeMap[e.ResultCode], e.Err.Error()) } -func NewError(resultCode uint8, err error) *Error { +func NewError(resultCode uint8, err error) error { return &Error{ResultCode: resultCode, Err: err} } |