{
"data": "string|array|null"
}
{
"data": "string"
}
{
"data": ["string", "string 2", "string 3...."]
}
type DataStruct struct {
Data string `json:"data"`
}
type DataStruct struct {
Data any `json:"data"`
}
//.....
if reflect.ValueOf(DataStruct.Data).Kind() == reflect.Slice {
//...
}
type StringOrStrings interface {
string | []string
}
type DataStruct[T StringOrStrings] struct {
Data T
}