// panic if node is in an impossible state for starting its visit func checkInitialState(node dag.Node) { if node.State() != dag.UNKNOWN { // we just skipped SOURCE nodes, the other states are only set // while visiting a node, and we should only visit each node // once panic(fmt.Sprintf( "visiting node %v, state = %s (should be UNKNOWN)", node, node.State())) } }