From Building a CLI application in Go
go.mod- Go Modules file used in Go for package managementmain.go- Main entrypoint of the applicationcomic.go- Go representation of the data as a struct and operations on itxkcd.go- xkcd client for making HTTP calls to the API, parsing response and saving to disk
Run the program as follows-
$ go run main.go -n 323 -o jsonOr build it as an executable binary for your laptop and then run-
$ go build .
$ ./go-grab-xkcd -n 323 -s -o json