github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/a45.gno (about) 1 package main 2 3 import "fmt" 4 5 func main() { 6 // NOTE: this becomes a .Data array 7 x := [11]byte{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3} 8 fmt.Println(x) 9 x[0] += 2 10 x[1] -= 2 11 x[2] *= 2 12 x[3] /= 2 13 x[4] %= 2 14 x[5] &= 2 15 x[6] &^= 2 16 x[7] |= 2 17 x[8] &= 2 18 x[9] <<= 2 19 x[10] >>= 2 20 fmt.Println(x) 21 } 22 23 // Output: 24 // [3 3 3 3 3 3 3 3 3 3 3] 25 // [5 1 6 1 1 2 1 3 2 12 0]