Imported struct from other package is undefined

前端 未结 1 1158
别那么骄傲
别那么骄傲 2020-12-22 04:54

Here is my noobish problem. I have this struct in my models/model.go

    package models

    import (
      \"time\"
      \"gopkg.in/mgo.v2/bso         


        
1条回答
  •  自闭症患者
    2020-12-22 05:51

    Use

    var horseStore = make(map[string]models.Horse)
    

    When accessing an identifier from another package you will always have to prefix it with the packages name and a dot: package.Identifier

    0 讨论(0)
提交回复
热议问题