goctopus / silk

yet another golang orm
MIT License
4 stars 4 forks source link

先试下三个接口吧 #24

Open dengtaobeijing opened 5 years ago

dengtaobeijing commented 5 years ago

Pull Put SortBy

chenhg5 commented 5 years ago

19

chenhg5 commented 5 years ago

@dengtaobeijing map需要做深复制,如:

a := map[string]interface{}{
        "product_id": 1,
        "name":       "Desk",
        "price":      100,
        "discount":   false,
}

c := Collect(a)
c.Pull("name"))

// 由于collection是imimmutable的,此时c.value不能变,需要跟a原来的值一样