package starmap import ( "fmt" "testing" ) type Miaomiao struct { Sakura string Fuck int Mimi bool } func Test_Remote(t *testing.T) { Store("nmb", 22222) server, err := NewServer("127.0.0.1:45678") server.Register(&Miaomiao{}) fmt.Println(err) client, err := NewClient("127.0.0.1:45678") client.SetKeepAlive(false) fmt.Println(err) _ = server fmt.Println(client.Get("nmb")) fmt.Println(client.Store("maio", Miaomiao{"sss", 222, true})) fmt.Println(client.Get("maio")) } func (cat *Miaomiao) GetName() string { return "miaomiao" } func Test_Remote2(t *testing.T) { server, err := NewServer("127.0.0.1:45678") server.Register(&Miaomiao{}) fmt.Println(err) client, err := NewClient("127.0.0.1:45678") //client.SetKeepAlive(false) fmt.Println(err) _ = server fmt.Println(client.StoreMap(&Miaomiao{"suki", 1127, false})) fmt.Println(client.GetMap("miaomiao")) }