From 2eea0c0a703e32b904741d52c9e2c9ae836c14b0 Mon Sep 17 00:00:00 2001 From: Samuel Stauffer Date: Wed, 19 Mar 2014 14:22:55 -0700 Subject: Use error instead of *Error --- conn.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'conn.go') diff --git a/conn.go b/conn.go index 02fbbdc..ebf87c1 100644 --- a/conn.go +++ b/conn.go @@ -45,7 +45,7 @@ type Conn struct { // Dial connects to the given address on the given network using net.Dial // and then returns a new Conn for the connection. -func Dial(network, addr string) (*Conn, *Error) { +func Dial(network, addr string) (*Conn, error) { c, err := net.Dial(network, addr) if err != nil { return nil, NewError(ErrorNetwork, err) @@ -57,7 +57,7 @@ func Dial(network, addr string) (*Conn, *Error) { // DialTLS connects to the given address on the given network using tls.Dial // and then returns a new Conn for the connection. -func DialTLS(network, addr string, config *tls.Config) (*Conn, *Error) { +func DialTLS(network, addr string, config *tls.Config) (*Conn, error) { c, err := tls.Dial(network, addr, config) if err != nil { return nil, NewError(ErrorNetwork, err) @@ -118,7 +118,7 @@ func (l *Conn) nextMessageID() uint64 { } // StartTLS sends the command to start a TLS session and then creates a new TLS Client -func (l *Conn) StartTLS(config *tls.Config) *Error { +func (l *Conn) StartTLS(config *tls.Config) error { messageID := l.nextMessageID() if l.isTLS { @@ -144,7 +144,7 @@ func (l *Conn) StartTLS(config *tls.Config) *Error { if l.Debug { if err := addLDAPDescriptions(packet); err != nil { - return NewError(ErrorDebugging, err.Err) + return err } ber.PrintPacket(packet) } @@ -158,7 +158,7 @@ func (l *Conn) StartTLS(config *tls.Config) *Error { return nil } -func (l *Conn) sendMessage(packet *ber.Packet) (chan *ber.Packet, *Error) { +func (l *Conn) sendMessage(packet *ber.Packet) (chan *ber.Packet, error) { if l.isClosing { return nil, NewError(ErrorNetwork, errors.New("ldap: connection closed")) } -- cgit v1.2.3