Separate where in query
<p>I need to separate <code>where</code> to validates values with conditional, Example</p>

<pre><code>email := "test@test.com"
if email != "" {
  db.Where("users.email LIKE ?", "%"+email+"%")
}
db.Where("users.name like ?", "%"+jhon+"%").Find(&amp;users)
</code></pre>

<p>That returns two queries:</p>

<p>1: <code>SELECT "users".* FROM "users" WHERE users.email LIKE '%test@test.com%'</code></p>

<p>2: <code>SELECT "users".* FROM "users" WHERE users.name LIKE '%jhon%'</code></p>

<p>but I need the result in only one query:</p>

<pre><code> SELECT "users".* FROM "users" WHERE users.email LIKE '%test@test.com%' and users.name LIKE '%jhon%'
</code></pre>

<p>Thanks!</p>