Last active
June 19, 2021 13:23
-
-
Save jeffotoni/9cd1a3832e788482b1b91eff3bd7a70d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
var i interface{} | |
i = "Go Engineering 2.0" | |
i = 2021 | |
i = 10.55 | |
r := i.(float64) | |
fmt.Println(r) | |
var i2 []interface{} | |
i2 = append(i2, "Go v2") | |
i2 = append(i2, 2022) | |
i2 = append(i2, 23.44) | |
i = map[int]string{ | |
0: "GO", | |
1: "C", | |
} | |
i2 = append(i2, i) | |
for _, x := range i2 { | |
fmt.Println(x) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment