Moved from python to golang:
jsonBlob := `{ "test" : {"thing":["team1", "team2"]}}`
type other map[string]Myset
type stuff map[string]other
type MySet struct {
set mapset.Set
}
//Custom unmarshaller
func (s *MySet) UnmarshalJSON(p []byte) error {
var a []interface{}
if err := json.Unmarshal(p, &a); err != nil {
return err
}
s.set = mapset.NewSet(a)
return nil
}
// Unmarshall it
var s stuff
err := json.Unmarshall(jsonBlob, &s)
if err != nil {
return err
}
but it throws: runtime error: hash of unhashable type []interface {}