/* If the slave is qalified to raise an election, call this function This function will initiallize the election message, and pass through the ring */ func RaiseElection(id int, caster multicaster.Multicaster, m map[int]int) { msg := multicaster.ElectionMsg{} msg.MasterSelectSet = make(map[int]bool) msg.NewMasterId = -1 msg.MasterSelectSet[id] = false // TODO: pass message to the next element in the link caster.SendElectionMessage(strconv.Itoa(m[id]), msg) for key, value := range m { fmt.Println("key: " + strconv.Itoa(key) + ", value: " + strconv.Itoa(value)) } //fmt.Println("Message sent to: " + strconv.Itoa(m[id])) }