// initOrder computes the Info.InitOrder for package variables. func (check *Checker) initOrder() { … } // findPath returns the (reversed) list of objects []Object{to, ... from} // such that there is a path of object dependencies from 'from' to 'to'. // If there is no such path, the result is nil. func findPath(objMap map[Object]*declInfo, from, to Object, seen map[Object]bool) []Object { … } // reportCycle reports an error for the given cycle. func (check *Checker) reportCycle(cycle []Object) { … } type dependency … type graphNode … // cost returns the cost of removing this node, which involves copying each // predecessor to each successor (and vice-versa). func (n *graphNode) cost() int { … } type nodeSet … func (s *nodeSet) add(p *graphNode) { … } // dependencyGraph computes the object dependency graph from the given objMap, // with any function nodes removed. The resulting graph contains only constants // and variables. func dependencyGraph(objMap map[Object]*declInfo) []*graphNode { … } type nodeQueue … func (a nodeQueue) Len() int { … } func (a nodeQueue) Swap(i, j int) { … } func (a nodeQueue) Less(i, j int) bool { … } func (a *nodeQueue) Push(x any) { … } func (a *nodeQueue) Pop() any { … }