code: func (g *Graph) Sort() (sorted []util.T, ok bool) {
  	if g.sorted != nil {
  		return g.sorted, true
  	}
  
  	sort := &graphSort{
  		sorted: make([]util.T, 0, len(g.nodes)),
  		deps:   g.Dependencies,
  		marked: map[util.T]struct{}{},
  		temp:   map[util.T]struct{}{},
  	}
  
  	for node := range g.nodes {
  		if !sort.Visit(node) {
  			return nil, false
  		}
  	}
  
  	g.sorted = sort.sorted
  	return g.sorted, true
  }
docs: // Sort returns a slice of rules sorted by dependencies. If a cycle is found,
  // ok is set to false.