title: How to write a gorm function for where clause with dynamic variables
body: <p>I need to create a sql query :</p>
  <pre><code>SELECT * FROM users WHERE id = 10 AND name = &quot;Chetan&quot;
  </code></pre>
  <p>Now, gorm's where function looks like below,</p>
  <pre><code>// Where return a new relation, filter records with given conditions, accepts `map`, `struct` or `string` as conditions, refer http://jinzhu.github.io/gorm/crud.html#query
  func (s *DB) Where(query interface{}, args ...interface{}) *DB {
      return s.clone().search.Where(query, args...).db
  }
  </code></pre>
  <p>Which mean it accepts a query and args. Example :</p>
  <pre><code>dbDriver.Where(&quot;id = ?&quot;, id).First(t)
  </code></pre>
  <p>How do i dynamically pass multiple variables. Example:</p>
  <pre><code>SELECT * FROM users WHERE id = 10 AND name = &quot;Chetan&quot;
  SELECT * FROM users WHERE id = 10
  SELECT * FROM users WHERE gender = &quot;male&quot; AND name = &quot;Chetan&quot; AND age = &quot;30&quot;
  </code></pre>
  <p>Is it poosible to write a single gorm function for such dynamic SQL statements?</p>