Try convert dynamic JSON to struct

why don’t you just unmarshal to the struct you created?

	var l Layout

	if err := json.Unmarshal(byt, &l); err != nil {
		panic(err)
	}

	fmt.Printf("layout: %+v",l)

https://play.golang.org/p/j8SchGKk2A5

1 Like