How to get number of records from the interface?

How can I get the total number of records with the key name from the interface which has different types?

type example1Struct struct {
Name string
FileName string

type example2Struct struct {
StudentId int
ClassName string

type exampleStruct struct {
Students map[string]interface{}
Clases map[string]interface{}

func getData() {

var err error

var ex1 map[string]interface{}

var ex2 map[string]interface{}

obj1 := ex1[“test”].(*map[string]map[int]testObj)
obj1 := ex2[“test”].(*map[string][]testObjArray)

obj2 := ex2[“test1”].(*map[TestStruct][]testArray)
obj3 := ex1[“test”].(*map[int]TestObjArray)

exampleStruct.Students = ex1

exampleStruct.Classes = ex2