github.com/aykevl/tinygo@v0.5.0/testdata/init.go (about)

     1  package main
     2  
     3  func init() {
     4  	println("init")
     5  }
     6  
     7  func main() {
     8  	println("main")
     9  	println("v1:", v1)
    10  	println("v2:", v2.x, v2.y)
    11  	println("v3:", len(v3), cap(v3), v3[0], v3[3])
    12  	println("v4:", len(v4), v4 == nil)
    13  	println("v5:", len(v5), v5 == nil)
    14  	println("v6:", v6)
    15  	println("v7:", cap(v7), string(v7))
    16  }
    17  
    18  type (
    19  	t2 struct {
    20  		x int
    21  		y int
    22  	}
    23  )
    24  
    25  var (
    26  	v1 = 3
    27  	v2 = t2{2, 5}
    28  	v3 = []int{2, 3, 5, 7}
    29  	v4 map[string]int
    30  	v5 = map[string]int{}
    31  	v6 = float64(v1) < 2.6
    32  	v7 = []byte("foo")
    33  )