code: func (g *marshalGraph) writeSubgraph(sg *marshalGraph, opts *DotOpts, depth int, w *indentWriter) {
  	if depth == 0 {
  		return
  	}
  	depth--
  
  	name := sg.Name
  	if opts.cluster {
  		// we prefix with cluster_ to match the old dot output
  		name = "cluster_" + name
  		sg.Attrs["label"] = sg.Name
  	}
  	w.WriteString(fmt.Sprintf("subgraph %q {\n", name))
  	sg.writeBody(opts, w)
  
  	for _, sg := range sg.Subgraphs {
  		g.writeSubgraph(sg, opts, depth, w)
  	}
  }
docs: // Write the subgraph body. The is recursive, and the depth argument is used to
  // record the current depth of iteration.