使用来自不同包golang的struct

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

The package is models which contains Requires struct used as slice. Have a look at Qualified identifiers for more understanding of how package works. In your case It needs a slice of Requires with models package, should be used as below:

Requires: []models.Requires{
{
    Name: "db",
}