Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- func main() {
- var im interface{}
- var in interface{}
- im = 3
- in = 2
- // type assertion
- m := im.(int)
- n := in.(int)
- fmt.Println(m + n)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement