go-learning/hello/hello.go

29 lines
610 B
Go
Raw Permalink Normal View History

2025-08-30 12:55:18 +00:00
package main
import (
"fmt"
"log"
"learning.local/using_modules"
)
func main () {
// Set properties of the predefined Logger, including
// the log entry prefix and a flag to disable printing
// the time, source fiile, and line number.
log.SetPrefix("using_modules: ")
log.SetFlags(0)
// A slice of names
names := []string{"Gladys", "Yoda", "Darth Vader"}
// Request greeting messages for the names
messages, err := using_modules.Hellos(names)
if err != nil {
log.Fatal(err)
}
// If no error was returned, print the returned map of
// messages to the console
fmt.Println(messages)
}