title: golang time.Now().Unix() discrepancy between documentation and implementation?
body: <p><a href="https://golang.org/pkg/time/#Unix" rel="nofollow">https://golang.org/pkg/time/#Unix</a></p>
  
  <p>states that the signature of this function is </p>
  
  <pre><code>func Unix(sec int64, nsec int64) Time
  </code></pre>
  
  <p>meaning, it returns a <code>Time</code> object.</p>
  
  <p>But the following program aborts with the error message:</p>
  
  <blockquote>
    <p>14: cannot use now.Unix() (type int64) as type time.Time in assignment`</p>
  </blockquote>
  
  <pre><code>func main() {
      var now time.Time
      now = time.Now()
      fmt.Println(now)
  
      var secs time.Time
      secs = now.Unix()
      fmt.Println(secs)
  }
  </code></pre>
  
  <p>The following version of the program produces output</p>
  
  <pre><code>func main() {
      var now time.Time
      now = time.Now()
      fmt.Println(now)
  
      // var secs time.Time
      secs := now.Unix()
      fmt.Println(secs)
  }
  </code></pre>
  
  <p><code>2016-04-12 18:20:22.566965512 -0400 EDT</code></p>
  
  <p><code>1460499622</code></p>
  
  <p>Is this just a matter of error in documentation?</p>