Lets imagine this code.
```go
var i int
func main() {
i = 3
F(i)
}
var q interface{}
//go:noinline
func F(a interface{}) {
q = a
}
```
then run `go tool compile -S ~/a.go`
Skipping all not related, in main function we'll see
```
0x001d 00029 (/home/nik/a.go:6) MOVQ $3, "".i(SB)
0x0028 00040 (/home/nik/a.go:8) MOVQ $3, (SP)
0x0030 00048 (/home/nik/a.go:8) PCDATA $1, $0
0x0030 00048 (/home/nik/a.go:8) CALL runtime.convT64(SB)
0x0035 00053 (/home/nik/a.go:8)
LEAQ
type.int(SB), AX
0x003c 00060 (/home/nik/a.go:8) MOVQ AX, (SP)
0x0040 00064 (/home/nik/a.go:8) CALL "".F(SB)
```
which allocates (except some small optimization) new `*int` variable instead of just copying value itself.
```go
type eface struct {
_type *_type
data unsafe.Pointer
}
```
`int` to `interface{}` conversion looks like
```go
v := new(int)
*v = value
return eface{
data: unsafe.Pointer(&v),
}
```
instead of
```go
return eface{
data: unsafe.Pointer(value),
}
```
I have some guess, that it is connected with garbage collection and requirement to know in advance if some piece of memory is pointer or not. But isn't it worth it to add some `if` in gc and do not make such allocations, reducing gc pressure?