mirror of https://github.com/tinygo-org/tinygo.git
wasmstm32webassemblymicrocontrollerarmavrspiwasiadafruitarduinocircuitplayground-expressgpioi2cllvmmicrobitnrf51nrf52nrf52840samd21tinygo
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
490 B
33 lines
490 B
package main
|
|
|
|
func init() {
|
|
println("init")
|
|
}
|
|
|
|
func main() {
|
|
println("main")
|
|
println("v1:", v1)
|
|
println("v2:", v2.x, v2.y)
|
|
println("v3:", len(v3), cap(v3), v3[0], v3[3])
|
|
println("v4:", len(v4), v4 == nil)
|
|
println("v5:", len(v5), v5 == nil)
|
|
println("v6:", v6)
|
|
println("v7:", cap(v7), string(v7))
|
|
}
|
|
|
|
type (
|
|
t2 struct {
|
|
x int
|
|
y int
|
|
}
|
|
)
|
|
|
|
var (
|
|
v1 = 3
|
|
v2 = t2{2, 5}
|
|
v3 = []int{2, 3, 5, 7}
|
|
v4 map[string]int
|
|
v5 = map[string]int{}
|
|
v6 = float64(v1) < 2.6
|
|
v7 = []byte("foo")
|
|
)
|
|
|