I'm trying to provide arguments to a Google Drive GoLang API (though you probably don't need to know anything about the API to answer the question). I'm new to Go and my build error message is confusing me.
One of the optional arguments is an array of parent folders into which an uploaded file should be stored in. A parent folder is referred to with a ParentRefernce struct. See the following snippet of Golang code:
parent := drive.ParentReference{Id: parent_folder}
parents := [...]*drive.ParentReference{&parent}
driveFile, err := service.Files.Insert(
&drive.File{Title: "Test", Parents: parents}).Media(goFile).Do()
The build error I'm getting is for the last line of the above snippet: cannot use parents (type [1]*drive.ParentReference) as type []*drive.ParentReference in field value
My confusion is around the distinction between [1]*Type and []*Type. It seems like the former is a specific length array and the latter is an array without specified length. Any clarification here would be useful.