I have a class (struct) like this:
type Question struct{ Question string answerOne string answerTwo string answerCorrect string }
You cannot by using only literals, but you could define a function.
func NewQuestion() *Question { q := &Question{ Question: "What?", answerOne: "A", answerTwo: "B", } q.answerCorrect = q.answerOne return q } // ... q1 := NewQuestion()