From 4e3f3713c8f6debc9a2844af538094968142a714 Mon Sep 17 00:00:00 2001 From: Samuel Stauffer Date: Wed, 19 Mar 2014 14:05:10 -0700 Subject: Some more cleanup --- conn.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'conn.go') diff --git a/conn.go b/conn.go index 2dca164..ab3f437 100644 --- a/conn.go +++ b/conn.go @@ -28,7 +28,7 @@ type messagePacket struct { Channel chan *ber.Packet } -// LDAP Connection +// Conn represents an LDAP Connection type Conn struct { conn net.Conn isSSL bool @@ -55,7 +55,7 @@ func Dial(network, addr string) (*Conn, *Error) { return conn, nil } -// Dial connects to the given address on the given network using net.Dial +// DialSSL connects to the given address on the given network using net.Dial // and then sets up SSL connection and returns a new Conn for the connection. func DialSSL(network, addr string, config *tls.Config) (*Conn, *Error) { c, err := tls.Dial(network, addr, config) @@ -68,7 +68,7 @@ func DialSSL(network, addr string, config *tls.Config) (*Conn, *Error) { return conn, nil } -// Dial connects to the given address on the given network using net.Dial +// DialTLS connects to the given address on the given network using net.Dial // and then starts a TLS session and returns a new Conn for the connection. func DialTLS(network, addr string, config *tls.Config) (*Conn, *Error) { c, err := net.Dial(network, addr) @@ -138,7 +138,7 @@ func (l *Conn) startTLS(config *tls.Config) *Error { messageID := l.nextMessageID() if l.isSSL { - return NewError(ErrorNetwork, errors.New("Already encrypted")) + return NewError(ErrorNetwork, errors.New("ldap: already encrypted")) } packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request") @@ -176,7 +176,7 @@ func (l *Conn) startTLS(config *tls.Config) *Error { func (l *Conn) sendMessage(packet *ber.Packet) (chan *ber.Packet, *Error) { if l.isClosing { - return nil, NewError(ErrorNetwork, errors.New("Connection closed")) + return nil, NewError(ErrorNetwork, errors.New("ldap: connection closed")) } out := make(chan *ber.Packet) message := &messagePacket{ -- cgit v1.2.3