package main

import (
	"github.com/davecgh/go-spew/spew"
)

type LineItem struct {
	ID          int
	Description string
	Value       int64
}

type Order struct {
	ID        int
	LineItems []*LineItem
}

func main() {
	o := Order{
		ID: 1,
		LineItems: []*LineItem{
			{ID: 1, Description: "plush gopher", Value: 1999},
			{ID: 2, Description: "gopher stickers - 100", Value: 999},
		},
	}

	// Basic dump - prints to stdout
	spew.Dump(o)

	// Printf-style with %v replacement
	spew.Printf("Order: %v\n", o)

	// Get string representation
	str := spew.Sdump(o)
	_ = str // use as needed

	// Configure output options
	config := spew.ConfigState{
		Indent:                  "    ",
		MaxDepth:                0,    // 0 = unlimited
		DisablePointerAddresses: true, // cleaner output
	}
	config.Dump(o)
}
