Creating your first Go project

Report a typo

Below you will see an unordered list of the go tool commands. Place them in the correct order to achieve the following:

  1. Create the hello workspace
  2. Initialize a Go module called hello
  3. Create the main.go file
  4. Install the external package hosted on GitHub: github.com/lib/pq
  5. Compile the main.go file
  6. Execute the compiled main binary file.

Assume that the contents of the main.go file will be automatically generated by a mystical and almighty artificial intelligence (AI) after creating the file.

Put the items in the correct order
go get github.com/lib/pq
touch main.go
go build main.go
go mod init hello
mkdir hello
./main
___

Create a free account to access the full topic