Exercises
Test out what you have learned by trying to complete the following exercises:
- Read the documentation of the
fmt
package usinggo doc
. - In UNIX, an exit code of
0
means success, whereas a non-zero exit code usually means failure. Try to modifywhich.go
to do so with the help ofos.Exit()
. - The current version of
which(1)
stops after finding the first occurrence of the desired executable. Make the necessary code changes towhich.go
in order to find all possible occurrences of the desired executable.