I am trying to print the data in a frame using the olog library. When I use the string variables inside a struct and use them in the []Data{}, it prints the data in a frame but when I use the TicketHeading array in a struct and use it inside the []Data{}, it gives me the following error.
Error
go: finding module for package github.com/da0x/golang/olog
go: downloading github.com/da0x/golang v1.0.4
./prog.go:17:23: invalid field name dt.TicketHeading[0] in struct literal
./prog.go:18:23: invalid field name dt.TicketHeading[1] in struct literal
Code
package main
import "github.com/da0x/golang/olog"
type Data struct {
TicketHeading [2]string
Ticket_title, Ticket_description string
}
func main() {
var dt Data
dt.TicketHeading = [2]string{"Ticket_titles", "Ticket_descriptions"}
var data = []Data{
{dt.TicketHeading[0]: "This is the ticket heading"},
{dt.TicketHeading[1]: "This is the ticket description"},
}
olog.Print(data)
}