github.com/goplus/gop@v1.2.6/printer/_testdata/06-String-Map-Array-Slice/datastruct.gop (about)

     1  x := []float64{1, 3.4, 5}
     2  y := map[string]float64{"Hello": 1, "xsw": 3.4}
     3  
     4  a := [...]float64{1, 3.4, 5}
     5  b := [...]float64{1, 3: 3.4, 5}
     6  c := []float64{2: 1.2, 3, 6: 4.5}
     7  
     8  x[1], y["xsw"] = 1.7, 2.8
     9  println("x:", x, "y:", y)
    10  println(`x[1]:`, x[1], `y["xsw"]:`, y["xsw"], `a[1]:`, a[1])
    11  
    12  i := uint16(4)
    13  b[uint32(4)], c[i] = 123, 1.7
    14  println("a:", a, "b:", b, "c:", c)
    15  
    16  arr := [...]float64{1, 2}
    17  title := "Hello,world!" + "2020-05-27"
    18  println(title[:len(title)-len("2006-01-02")], len(arr), arr[1:])