美文网首页Go
Go slice & struct

Go slice & struct

作者: JaedenKil | 来源:发表于2019-03-06 10:59 被阅读0次
package main

import "fmt"

func main() {

    r := []bool{true, false, true, false}
    fmt.Println(r)

    s := []struct{
        i int
        b bool
    }{
        {2, true},
        {3, false},
        {4, true},
    }
    fmt.Println(s)
}

Outputs:

[true false true false]
[{2 true} {3 false} {4 true}]

相关文章

网友评论

    本文标题:Go slice & struct

    本文链接:https://www.haomeiwen.com/subject/hgftpqtx.html