title: go run: cannot run non-main package
body: <p>here the simple go application. I am getting "go run: cannot run non-main package" error, if I run following code.</p>
  
  <pre><code>package zsdfsdf
  
  import (
      "fmt"
  )
  
  func Main() {
      fmt.Println("sddddddd")
  }
  </code></pre>
  
  <p>To fix it, I just need to name the package to <code>main</code>. But I don't understand why I need to do that. I should be able to name the package whatever I want.</p>
  
  <p>Another question, I know main function is the entry point of the program, you need it. otherwise it will not work. But I see some codes that didn't have main function still works.</p>
  
  <p>Click on this link, the example at the bottom of the page didn't use package main and main function, and it still works. just curious why.</p>
  
  <p><a href="https://developers.google.com/appengine/docs/go/gettingstarted/usingdatastore" rel="noreferrer">https://developers.google.com/appengine/docs/go/gettingstarted/usingdatastore</a></p>