mirror of
https://github.com/bootdotdev/fcc-learn-golang-assets.git
synced 2025-12-11 15:51:16 +00:00
37 lines
728 B
Go
37 lines
728 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func printReports(messages []string) {
|
|
// ?
|
|
}
|
|
|
|
// don't touch below this line
|
|
|
|
func test(messages []string) {
|
|
defer fmt.Println("====================================")
|
|
printReports(messages)
|
|
}
|
|
|
|
func main() {
|
|
test([]string{
|
|
"Here's Johnny!",
|
|
"Go ahead, make my day",
|
|
"You had me at hello",
|
|
"There's no place like home",
|
|
})
|
|
|
|
test([]string{
|
|
"Hello, my name is Inigo Montoya. You killed my father. Prepare to die.",
|
|
"May the Force be with you.",
|
|
"Show me the money!",
|
|
"Go ahead, make my day.",
|
|
})
|
|
}
|
|
|
|
func printCostReport(costCalculator func(string) int, message string) {
|
|
cost := costCalculator(message)
|
|
fmt.Printf(`Message: "%s" Cost: %v cents`, message, cost)
|
|
fmt.Println()
|
|
}
|