dououde4065
dououde4065
2016-11-17 15:51
浏览 59
已采纳

如何在Go结构体中初始化特定字段

If i had a Go struct with a long list of fields. Is there a built-in way to initialize an instance while providing value for specific fields only?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doutao4480
    doutao4480 2016-11-17 16:12
    已采纳

    You just have to write structType{fieldName: value} !

    点赞 评论

相关推荐