title: Go function definition in another package
body: <p>I am reading <a href="https://stackoverflow.com/questions/14938960/what-does-a-function-without-body-mean">this</a> post about time.startTimer declaration and definition. </p>
  
  <p>From the answer, time.startTimer is declared in <code>src/time/sleep.go</code>
  as follows:</p>
  
  <pre><code>func startTimer(*runtimeTimer)
  </code></pre>
  
  <p>And its definition is in <code>src/runtime/time.go</code> as follows:</p>
  
  <pre><code>func startTimer(t *timer) {
      if raceenabled {
          racerelease(unsafe.Pointer(t))
      }
      addtimer(t)
  }
  </code></pre>
  
  <p>So it seems that you can declare a function in one .go file and implement it in another .go file. I tried the same way, for example, declare a function in a.go and implement it in b.go, but it always failed when <code>go run a.go</code>. Is that the correct way to do so? How can I declare a function that is implemented in another .go file? There is no <code>import</code> in either <code>sleep.go</code> or <code>time.go</code>. How does Go do it?</p>
  
  <p>Thanks</p>