Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- func main() {
- var v interface{}
- // v is an integer.
- v = 1
- fmt.Println(v)
- // v becomes a string now.
- v = "Hello"
- fmt.Println(v)
- // v becomes a boolean value now.
- v = true
- fmt.Println(v)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement