I am very new to Golang and I am trying to do something that I thought would be easy enough and yet I am having trouble accomplishing it. Given the following code
package main
import (
"encoding/json"
"fmt"
"os"
)
type Example struct {
Data []struct {
Name string `json:"Name"`
Onboarded bool `json:"Onboarded"`
} `json:"data"`
}
func main() {
// This is what I am trying to figure out.
// How do I properly instantiate the Example type struct with values ?
// I'm not getting the Data part.
example := Example{
Data: ...
}
}
Any help is appreciated. Thanks.