i have 2 structs with a slice inside like this:
type BookX struct {
SomeValue string
Book1 []Book1
}
type Book1 struct {
Name string
Author string
}
type BookY struct {
SomeValue string
Book2 []Book2
}
type Book2 struct {
Name string
Author string
}
And i want to pass the values inside the first slice in the struct BookX to the other slice inside the BookY.
Tried this way but doesn't work:
func someName(bookX BookX){
var bookY BookY
bookY.Book2 = append(bookY.Book2, bookX.Book1...)
}