title: Interface Function Call on GoLang
body: <p>I am having a problem go interfaces. </p>
  
  <p>Here is my main.go file;</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "bitbucket.org/xyz/trash/a"
  )
  
  // Second -
  type Second interface {
      Area() float64
  }
  
  // Area -
  func Area() float64 {
      return 2
  }
  
  
  func main() {
  
      r := new(a.Rect)
  
      n := new(Second)
  
      r.F = *n
  
      fmt.Println(r.Area()) 
  
  }
  </code></pre>
  
  <p>And my other package, a.go;</p>
  
  <pre><code>package a
  
  // First -
  type First interface {
      Area() float64
  }
  
  // Rect -
  type Rect struct {
      F First 
  }
  
  // Area -
  func (r Rect) Area() float64 {
      return 1
  }
  </code></pre>
  
  <p>I am expecting this line</p>
  
  <p>fmt.Println(r.Area()) </p>
  
  <p>to print "2", not "1". What am i missing?</p>
  
  <p>Thanks for your help.</p>