* recursion_Golang * go_fmt * selection_sort_Golang * rm-golang * selection_sort_Golang * selection_sort_Golang * selection_sort_Golang * dynamic_golang * golang 05_hash_tables 02_check_voter.go * golang 05_hash_tables 01_price_of_groceries
22 lines
313 B
Go
22 lines
313 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
var voted map[string]bool
|
|
|
|
func main() {
|
|
voted = make(map[string]bool)
|
|
check_voter("tom")
|
|
check_voter("mike")
|
|
check_voter("mike")
|
|
}
|
|
|
|
func check_voter(name string) {
|
|
if voted[name] {
|
|
fmt.Println("kick tem out!")
|
|
} else {
|
|
voted[name] = true
|
|
fmt.Println("let tem vote!")
|
|
}
|
|
}
|