cmd/tools/gen-accessors.go
func (t *templateData) addArrayType(x *ast.ArrayType, receiverType, fieldName string) {
	// TODO: should we make this dynamic? Could handle more cases than string only
	var eltType string
	switch elt := x.Elt.(type) {
	case *ast.Ident:
		eltType = elt.String()
	default:
		logf("addArrayType: type %q, field %q: unknown element type: %T %+v; skipping.", receiverType, fieldName, elt, elt)
		return
	}

	t.Accessors = append(t.Accessors, newAccessor(receiverType, fieldName, "[]"+eltType, "nil"))
}
func (t *templateData) addArrayType(x *ast.ArrayType, receiverType, fieldName string) {
	// TODO: should we make this dynamic? Could handle more cases than string only
	var eltType string
	switch elt := x.Elt.(type) {
	case *ast.Ident:
		eltType = elt.String()
	default:
		logf("addArrayType: type %q, field %q: unknown element type: %T %+v; skipping.", receiverType, fieldName, elt, elt)
		return
	}

	t.Accessors = append(t.Accessors, newAccessor(receiverType, fieldName, "[]"+eltType, "nil"))
}
// addArrayType adds an accessor for a array type for a given receiver and field