title: How to use custom packages
body: <p>I'm trying to create and use a custom package in Go. It's probably something very obvious but I cannot find much information about this. Basically, I have these two files in the same folder:</p>
  
  <p><strong>mylib.go</strong></p>
  
  <pre><code>package mylib
  
  type SomeType struct {
  
  }
  </code></pre>
  
  <p><strong>main.go</strong></p>
  
  <pre><code>package main
  
  import (
      "mylib"
  )
  
  func main() {
  
  }
  </code></pre>
  
  <p>When I try to <code>go run main.go</code>, I get this error:</p>
  
  <pre><code>main.go:4:2: import "mylib": cannot find package
  </code></pre>
  
  <p>I've tried to run <code>go build mylib.go</code> first but it doesn't seem to be doing anything (no file generated, no error message). So any idea how I could do this?</p>