jweinst1
5/4/2016 - 11:53 PM

typeassertion.go

package main
//go program to implement a portable VM

import (
    "fmt"
)

func Add(first, second interface{}) interface{} {
	return first.(int) + second.(int)
}



func main(){
	fmt.Println(Add(5, 6))
	//prints 11
}
//generic types using assertion