I have a class (struct) like this:
type Question struct{ Question string answerOne string answerTwo string answerCorrect string }
Analog to setting the correctAnswer field after creating the Question value, you can store the correct answer in a variable prior, and use that twice in the composite literal:
correctAnswer
Question
answerA := "A" q := Question{ Question: "What?", answerOne: answerA, answerTwo: "B", answerCorrect: answerA, }