数组中的引用类型

Look at the following code snippet

// Prepare some data to insert into the template.
type Recipient struct {
    Name, Gift string
    Attended   bool
}
var recipients = []Recipient{
    {"Aunt Mildred", "bone china tea set", true},
    {"Uncle John", "moleskin pants", false},
    {"Cousin Rodney", "", false},
}

I create a struct with some properties. After create a slice with Recipient type. Does slice recipients keeps value or reference type inside?

It seems to be value type.

A slice is in fact a (kind of) pointer to a portion of an array (see slice usage and internals), so as for arrays, items are values of the specified type.

It keeps whatever you declared your slice to be. In your case, you declared as []Recipient, so it will keep the data as value.

If you declare a slice as []*Recipient, then it will hold references (*Recipient), not Recipient values.