Golang, variável com tipo de string
É possível criar variável com o tipo from string?
Exemplo:
Eu tenho dois tipos:
type FirstType struct {
...
}
type SecondType struct {
...
}
// also I have a string variable
var1 := "Second"
Eu quero criar variável com o tipo -String value + "Type"
:
var variable = []var1+"Type" // slice of "SecondType"
O resultado esperado é como neste caso:
var variable = []SecondType
Obrigado!