title: Get a Bitmap type filter queried from URL in Golang
body: <p>I'm working on a large Go web app built with Gin framework. For one of the APIs requesting user info, there is a filter parameter whose input type is <code>bitmap</code>, denoting whether user is online or offline:</p>
  <pre class="lang-golang prettyprint-override"><code>// SearchUsers API parameter: filterUser
  // filterUser is a bitmap
  Online: 1 &lt;&lt; 0
  Offline: 1 &lt;&lt; 1
  
  
  // Values:
  0 -&gt; not used
  1 -&gt; online
  2 -&gt; offline
  3 -&gt; all (online, offline)
  </code></pre>
  <p>Right now I'm parsing all the API parameters using <code>Request.URL.Query</code>. I was wondering if this works the same for bitmap type as well? Do I need to create a <code>[]byte</code> to process the input and then convert it to integer for DB queries?</p>
  <pre class="lang-golang prettyprint-override"><code>func (h *HandleManager) SearchUsers() gin.HandlerFunc {
      return func(c *gin.Context) {
          // ...
          q := c.Request.URL.Query()
          filterUsers := q.Get(&quot;filterUser&quot;)
          if filterUsers != &quot;&quot; {
              filterUsersByte := []byte(filterUsers)
          } 
  
  </code></pre>