Slide 9
Slide 9 text
package main
import "fmt"
func main() {
friend := "DDD East Anglia"
fmt.Printf("Hello, %s", friend)
}
Package declaration. Main
pkg produces a binary.
Import statements.
Function declaration. Main
pkg must have function main.
Variable. Will infer the type
based on the right side of :=.
Print a string using the
‘fmt’ package.