github.com/goplus/llgo@v0.8.3/cl/_testrt/builtin/in.go (about)

     1  package main
     2  
     3  import (
     4  	"unsafe"
     5  )
     6  
     7  var a int64 = 1<<63 - 1
     8  var b int64 = -1 << 63
     9  var n uint64 = 1<<64 - 1
    10  
    11  func main() {
    12  	var s = []int{1, 2, 3, 4}
    13  	var a = [...]int{1, 2, 3, 4}
    14  	d := make([]byte, 4, 10)
    15  	println(s, len(s), cap(s))
    16  	println(d, len(d), cap(d))
    17  	println(len(a), cap(a), cap(&a), len(&a))
    18  	println(len([]int{1, 2, 3, 4}), len([4]int{1, 2, 3, 4}))
    19  	println(len(s[1:]), cap(s[1:]), len(s[1:2]), cap(s[1:2]), len(s[1:2:2]), cap(s[1:2:2]))
    20  	println(len(a[1:]), cap(a[1:]), len(a[1:2]), cap(a[1:2]), len(a[1:2:2]), cap(a[1:2:2]))
    21  
    22  	println("hello", "hello"[1:], "hello"[1:2], len("hello"[5:]))
    23  	println(append(s, 5, 6, 7, 8))
    24  	data := []byte{'a', 'b', 'c'}
    25  	data = append(data, "def"...)
    26  	println(data)
    27  	var i any = 100
    28  	println(true, 100, -100, uint(255), int32(-100), 100.5, i, &i, uintptr(unsafe.Pointer(&i)))
    29  }