草庐IT

Salience

全部标签

google-app-engine - 无法在 golang 中对数据存储类型的实体进行排序

在我的应用程序中,我使用go1.11作为后端。它在谷歌数据存储中执行CRUD操作。我可以从特定种类中检索实体,但顺序不可预测。我正在使用以下数据存储模块:"cloud.google.com/go/datastore"我的结构是:typeRuleDSstruct{Idstring`json:"id"datastore:"id"`Namestring`json:"name"datastore:"name"`Salienceint`json:"salience"datastore:"salience"`CreatedAttime.Time`json:"createdAt"datastore: