title: Assert if variable of type []interface{} is actually []string
body: <p>I am developing a RESTful API, and need to make sure of what user has sent.</p>
  <p>Suppose this is the body of a POST request in JSON format:</p>
  <pre><code>{
      &quot;request&quot;: &quot;reset-users&quot;,
      &quot;parameters&quot;: [
          {
              &quot;users&quot;: [&quot;userA&quot;,&quot;userB&quot;,&quot;userC&quot;]
          }
      ]
  }
  </code></pre>
  <p>Using <code>json.Unmarshal</code>, I read the body into this standardized struct:</p>
  <pre><code>type RequestBody struct {
      Request string `json:&quot;request&quot;`
      Parameters []map[string]interface{} `json:&quot;parameters&quot;`
  }
  </code></pre>
  <p>So, Now, I can check the type of <code>requestBody.Parameters[0][&quot;users&quot;]</code> with the following type assertion switch block:</p>
  <pre><code>switch requestBody.Parameters[0][&quot;users&quot;].(type) {
      case []interface {}:
          //It is actually a list of some type
      default:
          //Other types
  }
  </code></pre>
  <p>The above mentioned code works but how can I also be sure that <em><strong>a list of some type</strong></em> is a list of strings? (as opposed to a list of int or bool ...)</p>