Writing your first program

The simplest package you can have is a single file inside a directory. Create a new file, ~/src/hello/hello.go, and put the following code inside:

package mainimport "fmt"func main() {   fmt.Println("Hello, world.")}

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.