Foundation of Go Language —— 05. set (Not translated)
»
    Go语言中set由特定的map转变而来:
    var set = map[string]struct{}{"a": {}, "b": {}}
    其中,struct{}空结构体为了节省set占用的内存空间

    这是一段例子代码:
    var set = map[string]struct{}{"a": {}, "b": {}}
    if _, exists := set["a"]; exists {
        fmt.Println(true)
    }

    ————www.v-signon.com学习者共勉
                        
«
--Alex.Zhang
--www.v-signon.com Learningers Co-Encouraged
Back
Personal Art: www.up-task.com Unit: Individual
中文 Русский 京ICP备19038994号-2
If the content on this website infringes upon your any rights, please contact me at 1307776259@qq.com for removal