title: Struct is not a type when passed as a parameter to a function in a separate package
body: <p>I'm making a JSON validation function and I'm trying to implement it. However I'm having issues with my structs when I try to import them as a parameter to my validation function, which is in another package.</p>
  
  <p>The reason to why it's in another package is because a universal validation function that I will call in different route files, so I can't actually have any structs inside that package, they must be imported and defined in the route file.</p>
  
  <pre><code>type UsersJSON struct {
      Users struct {
          Put []UserJSON `json:"PUT"`
      } `json:"users"`
  }
  
  type UserJSON struct {
      display_name     string `json:"display_name"`
      username        string `json:"username"`
      email           string `json:"email"`
      password        string `json:"password"`
  }
  
  func MyFunc(w http.ResponseWriter, r *http.Request) {
      errors, _ := schema.Validate(data, r, UsersJSON)
  }
  
  func Validate(schemaHelper interface{}) (interface{}, error) {
      file, err := os.Open("config/schema/schema.json")
      if err != nil {
          return nil, err
      }
  
      defer file.Close()
  
      byteValue, _ := ioutil.ReadAll(file)
  
      var helpers schemaHelper // this is the error
  
      json.Unmarshal(byteValue, &amp;helpers)
      fmt.Printf("%v", helpers)
  }
  </code></pre>
  
  <p>My JSON schema looks like this:</p>
  
  <pre><code>{
      "users": {
          "PUT": {
          }
      }
  }
  </code></pre>
  
  <p>I want to make this method work because it makes automating validation much easier and faster.</p>
  
  <p>This doesn't compile and gives the error <code>schemaHelper is not a type</code></p>
  
  <p>Any idea how I can solve this?</p>