Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

29 lines
458 B

package main
import "fmt"
func main() {
itemsSold()
}
func itemsSold() {
items := make(map[string]int)
items["John"] = 41
items["Celina"] = 109
items["Micah"] = 24
for k, v := range items {
fmt.Printf("%s sold %d items and ", k, v)
if v < 40 {
fmt.Println("is below expectations")
} else if v > 40 && v <= 100 {
fmt.Println("meets expectations")
} else {
fmt.Println("exceeded expectations")
}
}
}