I have this code
package main
import "fmt"
type MyType int
func main() {
var i interface{} = 12
f := i.(MyType)
fmt.Println(f)
}
However, I get this error:
panic: interface conversion: interface is int, not main.MyType
However, int is, in this case, the same as MyType. Is there any way to do this without using the same type?