package main func getEvents() []event { db := dbConnect("root", "", "localhost", "3306", "ctdo") rows := dbQuerry(db, "SELECT * FROM events;") events := []event{} for rows.Next() { Event := new(event) err := rows.Scan(&Event.date, &Event.description, &Event.media, &Event.title) if err != nil { panic(err) } events = append(events, *Event) } return events }