jeudi 22 septembre 2016

Dump an array of interfaces in golang

I have an array of interfaces like this :

type Test struct {
    Name string
}

func main() {
    result := []Test{
        Test{Name: "ahmad"},
        Test{Name: "reza"},
    }
    dump(result)
}

How can I dump this array and make a string like this:


Name

ahmad

reza


I want something like this but with arrays.





Aucun commentaire:

Enregistrer un commentaire