()
| 120 | ) |
| 121 | |
| 122 | func rainbowColor() colorFunc { |
| 123 | mutex.Lock() |
| 124 | defer mutex.Unlock() |
| 125 | result := rainbow[currentIndex] |
| 126 | currentIndex = (currentIndex + 1) % len(rainbow) |
| 127 | return result |
| 128 | } |
| 129 | |
| 130 | func init() { |
| 131 | colors := map[string]colorFunc{} |