github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/testdata/print.go (about)

     1  package main
     2  
     3  func main() {
     4  	// test basic printing
     5  	println("hello world!")
     6  	println(42)
     7  	println(100000000)
     8  
     9  	// check that this one doesn't print an extra space between args
    10  	print("a", "b", "c")
    11  	println()
    12  	// ..but this one does
    13  	println("a", "b", "c")
    14  
    15  	// print integers
    16  	println(uint8(123))
    17  	println(int8(123))
    18  	println(int8(-123))
    19  	println(uint16(12345))
    20  	println(int16(12345))
    21  	println(int16(-12345))
    22  	println(uint32(12345678))
    23  	println(int32(12345678))
    24  	println(int32(-12345678))
    25  	println(uint64(123456789012))
    26  	println(int64(123456789012))
    27  	println(int64(-123456789012))
    28  
    29  	// print float64
    30  	println(3.14)
    31  
    32  	// print float32
    33  	println(float32(3.14))
    34  
    35  	// print complex128
    36  	println(5 + 1.2345i)
    37  
    38  	// print interface
    39  	println(interface{}(nil))
    40  
    41  	// print map
    42  	println(map[string]int{"three": 3, "five": 5})
    43  
    44  	// TODO: print pointer
    45  
    46  	// print bool
    47  	println(true, false)
    48  
    49  	// print slice
    50  	println([]byte(nil))
    51  	println([]int(nil))
    52  }