good morning!!!!

Skip to content
Snippets Groups Projects
Commit f72a2f4a authored by Peter Kieltyka's avatar Peter Kieltyka
Browse files

Have .And and .Or return a new array instead of mutating itself

parent a8b530e2
No related branches found
No related tags found
No related merge requests found
...@@ -100,8 +100,8 @@ type Func struct { ...@@ -100,8 +100,8 @@ type Func struct {
// } // }
type And []interface{} type And []interface{}
func (a *And) And(exp interface{}) { func (a And) And(exp interface{}) And {
*a = append(*a, exp) return append(a, exp)
} }
// Or is an array of interfaced that is used to join two or more expressions // Or is an array of interfaced that is used to join two or more expressions
...@@ -117,8 +117,8 @@ func (a *And) And(exp interface{}) { ...@@ -117,8 +117,8 @@ func (a *And) And(exp interface{}) {
// } // }
type Or []interface{} type Or []interface{}
func (o *Or) Or(exp interface{}) { func (o Or) Or(exp interface{}) Or {
*o = append(*o, exp) return append(o, exp)
} }
// Raw holds chunks of data to be passed to the database without any filtering. // Raw holds chunks of data to be passed to the database without any filtering.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment