August 2019
Beginner to intermediate
798 pages
17h 2m
English
Standard output is more or less equivalent to printing on the screen. However, using standard output might require the use of functions that do not belong to the fmt package, which is why it is presented in its own section.
The relevant technique will be illustrated in stdOUT.go and will be offered in three parts. The first part of the program is as follows:
package main
import (
"io"
"os"
)
So, stdOUT.go will use the io package instead of the fmt package. The os package is used for reading the command-line arguments of the program and for accessing os.Stdout.
The second portion of stdOUT.go contains the following Go code:
func main() { myString := "" arguments := os.Args if len(arguments) == 1 { myString = "Please ...Read now
Unlock full access