package main
import "fmt"
func main() {
// this is equivalent to:
// p := []int{2, 3, 5, 7, 11, 13}
// primes := p[0:6]
primes := []int{2, 3, 5, 7, 11, 13}
fmt.Println(primes)
// just combining a struct and an slice
// for fun
s := []struct {
i int
b bool
}{
{2, true},
{3, false},
{5, true},
{7, true},
{11, false},
{13, true},
}
fmt.Println(s)
}
To embed this program on your website, copy the following code and paste it into your website's HTML: