|
|
|
@ -9,6 +9,7 @@ type Useless struct {
|
|
|
|
|
Leader string `db:"leader"`
|
|
|
|
|
Usable bool `db:"use"`
|
|
|
|
|
O *Whoami `db:"---"`
|
|
|
|
|
Data []byte `db:"data"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Whoami struct {
|
|
|
|
@ -29,10 +30,15 @@ func TestUpInOrm(t *testing.T) {
|
|
|
|
|
func Test_SetRefVal(t *testing.T) {
|
|
|
|
|
var hehe = Useless{
|
|
|
|
|
Leader: "no",
|
|
|
|
|
Data: []byte{1, 2, 3},
|
|
|
|
|
}
|
|
|
|
|
fmt.Printf("%+v\n", hehe)
|
|
|
|
|
fmt.Println(setRefValue(&hehe, "db", "leader", "sb"))
|
|
|
|
|
fmt.Printf("%+v\n", hehe)
|
|
|
|
|
fmt.Println(getAllRefKey(hehe, "db"))
|
|
|
|
|
fmt.Println(getAllRefValue(hehe, "db"))
|
|
|
|
|
|
|
|
|
|
fmt.Println(setRefValue(&hehe, "db", "data", []byte{4, 5, 6, 7, 8}))
|
|
|
|
|
fmt.Printf("%+v\n", hehe)
|
|
|
|
|
fmt.Println(getAllRefKey(hehe, "db"))
|
|
|
|
|
fmt.Println(getAllRefValue(hehe, "db"))
|
|
|
|
|