呼唤远方
让数据存储为您生成字符串键的方法是使用NewIncompleteKey.ikey := datastore.NewIncompleteKey(ctx, "Thing", nil)key, _ := datastore.Put(ctx, ikey, nil) // TODO: check the errorfmt.Println(key.Encode()) // randomly-generated string key然后从字符串键取回它......ks := req.FormValue("key") // e.g., from an HTTP request parameterkey, _ := datastore.DecodeKey(ks) // TODO: check the errorvar t Thing_ = datastore.Get(ctx, key, &t) // TODO: check the error