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 --- filter.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'filter.go') diff --git a/filter.go b/filter.go index 9d01d28..63f5d07 100644 --- a/filter.go +++ b/filter.go @@ -49,7 +49,7 @@ var FilterSubstringsMap = map[uint64]string{ FilterSubstringsFinal: "Substrings Final", } -func CompileFilter(filter string) (*ber.Packet, *Error) { +func CompileFilter(filter string) (*ber.Packet, error) { if len(filter) == 0 || filter[0] != '(' { return nil, NewError(ErrorFilterCompile, errors.New("ldap: filter does not start with an '('")) } @@ -63,7 +63,7 @@ func CompileFilter(filter string) (*ber.Packet, *Error) { return packet, nil } -func DecompileFilter(packet *ber.Packet) (ret string, err *Error) { +func DecompileFilter(packet *ber.Packet) (ret string, err error) { defer func() { if r := recover(); r != nil { err = NewError(ErrorFilterDecompile, errors.New("ldap: error decompiling filter")) @@ -136,7 +136,7 @@ func DecompileFilter(packet *ber.Packet) (ret string, err *Error) { return } -func compileFilterSet(filter string, pos int, parent *ber.Packet) (int, *Error) { +func compileFilterSet(filter string, pos int, parent *ber.Packet) (int, error) { for pos < len(filter) && filter[pos] == '(' { child, newPos, err := compileFilter(filter, pos+1) if err != nil { @@ -152,9 +152,9 @@ func compileFilterSet(filter string, pos int, parent *ber.Packet) (int, *Error) return pos + 1, nil } -func compileFilter(filter string, pos int) (*ber.Packet, int, *Error) { +func compileFilter(filter string, pos int) (*ber.Packet, int, error) { var packet *ber.Packet - var err *Error + var err error defer func() { if r := recover(); r != nil { -- cgit v1.2.3