Hi.
New to go.
Working with some code, and overview is I would like to convert the contents of a struct, which is holding unmarshalled json into an array so it can be used in an API that only accepts []string format.
I have tried various ways of doing this, but being new I’m obviously missing something simple.
i.e. struct
type Log struct {
CommonLabels CommonLabels json:"commonLabels"
}
type CommonLabels struct {
name string json:"name"
note string json:"note"
}
So I have values in my struct and can print them if addressing them as Log.CommonLabels.name etc
But I would like to have the name and note for example in a []string format. So I can pass the values to the matching field in the API.
cheers in advance
J.