【问题标题】:Google Datastore nested entity's in GolangGolang 中的 Google Datastore 嵌套实体
【发布时间】:2015-05-30 06:52:19
【问题描述】:

我在设计模型时遇到了一些问题, 因为我的模型包含一个切片,我得到一个错误

flattening nested structs leads to a slice of slices

设计这样的东西的最佳方法是什么

我更喜欢改变我的设计,而不是像这篇文章中建议的那样创建自己的序列化方法:

Loading datastore entities from Python project in Go leads to nested structs slices of slices error

type Inner2 struct {
    Y      float64
    inner3 []Inner3
}

type Inner3 struct {
    Z bool
}

type Outer struct {
    A int16
    I []Inner2
}

【问题讨论】:

标签: google-app-engine go google-cloud-datastore google-cloud-storage


【解决方案1】:

cloud.google.com/go/datastore 将在几天后修复此问题 - 支持嵌套实体值!

详情请看这里的帖子: https://groups.google.com/forum/#!topic/google-api-go-announce/79jtrdeuJAg

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-18
    • 2019-08-07
    相关资源
    最近更新 更多