- Go Standard Library Cookbook
- Radomír Sohlich
- 80字
- 2021-06-24 18:56:23
How to do it...
The following steps cover the solution:
- Open the console and create the folder chapter01/recipe01.
- Navigate to the directory.
- Create the main.go file with the following content:
package main
import (
"log"
"runtime"
)
const info = `
Application %s starting.
The binary was build by GO: %s`
func main() {
log.Printf(info, "Example", runtime.Version())
}
- Run the code by executing the go run main.go.
- See the output in the Terminal: