You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 802. Find Eventual Safe States.go
    path of file: ./repos/LeetCode-Go/leetcode/0802.Find-Eventual-Safe-States
    
    the code of the file until where you have to start completion: package leetcode

func eventualSafeNodes(graph [][]int) []int {
	res, 
    
func dfsEventualSafeNodes(graph [][]int, idx int, color []int) bool {
	if color[idx] > 0 {
		return color[idx] == 2
	}
	color[idx] = 1
	for i := range graph[idx] {
		if !dfsEventualSafeNodes(graph, graph[idx][i], color) {
			return false
		}
	}
	color[idx] = 2
	return true
}