So, I have 2 structs below and I'm wondering how to return data from one in another where there's no specific/available point to return it from
type Workspace struct {
Channels []string `json:"channel_ID"`
Permissions []PermissionData `json:"available_permissions"`
}
type PermissionData struct {
ID int64 `json:"id,string"`
Name string `json:"name"`
PermissionID int64 `json:"permission_id,omitempty"`
Moderated bool `json:"moderated"`
}
Data looks something like;
Channels returns several IDs such as [1 2 3 4]
Whereas Permissions returns data about the permissions [{1 Access 1 False} {1 Write 2 False} {3 Edit 7 True}]
To note. The channel_ID and id from each struct matches. So it's not random.
The data has to be structured this way.
Would it be possible to return the object data for PermissionData within the Channels at all?