douyou1960
2016-11-21 12:18
浏览 2.2k
已采纳

如何使用Golang从一个函数返回不同类型的结构?

I have a function which queries database, then, depending on result form it, can create a struct OrderWithoutDetails or OrderWithDetails depending on the presence of details about the order.

How do I make the function to be able to return result of both types?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题