You can't get a *value* out of a *type*.  However if you have a *variable* 
of type Order, e.g.

var o Order

then you could do for example: o.Items[0].TotalPrice to get the TotalPrice 
of the first item.

Note: it would be conventional to have "type Item" rather than "type 
Items", because this type represents a single item.  That is, it would be 
clearer as:

type Order struct {
    ...
    Items  []Item
    ...
}
type Item struct {
    ...
}

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/de8fbf6e-acd3-4831-be80-e027f122f132n%40googlegroups.com.

Reply via email to