title: In golang why an interface variable can get address of a struct variable but cannot from a basic type variable?
body: <p>I am learning golang from "gotour" tool with "go1.10 darwin/amd64".</p>
  
  <p>For below case:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  type Myapi interface {
      fun1() int
  }
  
  type MyintA struct {
      val int
  }
  
  type MyintB int
  
  func (v *MyintA)fun1() int {
      return int(v.val) + 1
  }
  
  func (v *MyintB)fun1() int {
      return int(*v) + 1
  }
  
  func main() {
      var a Myapi
      a = &amp;MyintA{3}
      fmt.Println(a)
      a = &amp;MyintB(2) // Need b:=MyintB(2); a=&amp;b
      fmt.Println(a)
  }
  </code></pre>
  
  <p>The compiling error is:</p>
  
  <blockquote>
    <p>$ go run try.go</p>
    
    <p># command-line-arguments </p>
    
    <p>./try.go:27:9: cannot take the address of MyintB(2)</p>
  </blockquote>
  
  <p>Why the interface variable could get address directly from MyintA but not MyintB in this case?</p>