title: Interface has no field or method for an exported field in a struct
body: <p>I have code that has following structure:</p>
  
  <pre><code>// $GOPATH/experiments/interfaceexport/printer/printer.go
  package printer
  
  import "fmt"
  
  type ResourcePrinter interface {
      PrintSomething()
  }
  
  type JSONPrinter struct {
      IsGeneric bool
  }
  
  func (printer *JSONPrinter) PrintSomething() {
      fmt.Println("JSON")
  }
  
  // $GOPATH/experiments/interfaceexporter/printerretriever/printerretriever.go
  package printer
  
  import "experiments/interfaceexporter/printer"
  
  func GetPrinter() printer.ResourcePrinter {
    return &amp;printer.JSONPrinter{IsGeneric: true}
  }
  
  
  // $GOPATH/experiments/interfaceexport/main.go
  import "experiments/intefaceexport/printerretriever"
  
  func main() {
    printer := printerretriever.GetPrinter()
  
    printer.PrintSomething() // "JSON"
    // interfaceexport/main.go:13: printer.IsGeneric undefined (type printer.ResourcePrinter has no field or method IsGeneric)
    if printer.IsGeneric {
      printer.PrintSomething()
    }
  }
  </code></pre>
  
  <p>When I do <code>go run main.go</code> I get following error:</p>
  
  <p><code>interfaceexport/main.go:13: printer.IsGeneric undefined (type printer.ResourcePrinter has no field or method IsGeneric)</code></p>
  
  <p>Why do I get above error even though <code>IsGeneric</code> is exported?</p>