September 2017
Intermediate to advanced
466 pages
9h 33m
English
Now, let us try something different and tricky: you are going to try to find the summary of the command-line arguments given to your Go program. Therefore, you are going to consider the command-line arguments as numbers. Although the main idea remains the same, the implementation is totally different because you will have to convert your command-line arguments into numbers. The name of the Go program will be addCLA.go, and it can be split into two parts.
The first part is the preamble of the program:
package main import ( "fmt" "os" "strconv" )
You need the fmt package for printing your output and the os package for reading the command-line arguments. As command-line arguments are stored as strings, ...
Read now
Unlock full access