title: Structure & maintain a Golang project with multiple files
body: <p>I'm currently discovering Golang and I'm currently playing with Mux and Gorm to try to build an API.</p>
  
  <p>So everything is fine until the point where I have too much content in my main.go file so I want to split this API into multiple files,</p>
  
  <p>Naturally, like I would do in a Node.js API, I create a models Folder, and a routes folder, and begin to put my Models in individual files in the models folder (model1.go, model2.go etc) to have a structure like:</p>
  
  <p><code>/MyProject
     |main.go
     |/models
        |model1.go
        |model2.go
  </code></p>
  
  <p>Then I google a bit (well, a lot now..) to know how to include them in my main.go file, and now i'm facing the fact that in Golang the design of <strong>the language wants that any external file is a package</strong> which may be used by any other golang app, which is not what I'm looking for, <strong>I just want to split the content of my project to have a better maintainability</strong> but it seems to be impossible with that project design in mind.
  I heard about vendoring since 1.6 but that's still not a solution cause that's make necessary to keep the dependencies and the project files at the same place, which is not a conventional (and logical) way to structure a project</p>
  
  <p>I guess heavy and complex Golang projects don't have their entire code base into one single file so <strong>I'm just looking for the good way to structure a project into multiple files</strong> like they would do to maintain their projects.</p>