英文:
Which of these two import statements for the MongoDB/golang mgo driver is correct?
问题
这两个导入语句是用于同一个 mgo(MongoDB/golang)库的,它们之间有什么区别呢?
gopkg.in/mgo.v2
labix.org/v2/mgo
我知道你必须选择其中一个,但它们对我来说似乎都能正常工作。为什么会有两个版本,我应该使用哪一个?
英文:
Could someone shed some light on the difference between these two import statements for the same mgo (MongoDB/golang) library:
gopkg.in/mgo.v2
labix.org/v2/mgo
I know you have to pick one or the other, but they both seem to work the same for me. Why are there two and which one should I be using?
答案1
得分: 0
它们是同一个包,mgo没有强制规定规范的导入方式。
根据文档的说明,使用"gopkg.in/mgo.v2"。
英文:
They are the same package, and there is no canonical import enforced for mgo.
Use the "gopkg.in/mgo.v2", if only because that's what the documentation states.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论