I'm calling to object from current file which works (i'm creating unit test)
type Requires struct {
Name string `yaml:"name,omitempty"`
}
and I call it inside test like
Requires: []Requires{
{
Name: "db",
}
which works ok,
Now I move the Requires
struct to different package models
and I try to call it like
Requires: models.Requires{
{
Name: "db",
}
cannot use models.require as type
[]Require
also tried with models.[]Requires
This give me the error
use of package without selector error
Getting a use of package without selector error
But not sure how to handle it for my case...
Any idea how to overcome this ?
UPDATE
When I try it like following
Requires: models.Requires{
Name: “db",
},
},
I got error
cannot use models.Requires literal (type models.Requires) as type []models.Requires in field value
This is the error from viscose