Exercises
- Find and read the documentation of the
time
package. - Try to change the Go code of
userFiles.go
in order to support multiple users. - Change the Go code of
insertLineNumber.go
in order to read the input file line by line, write each line to a temporary file, and then, replace the original file with the temporary one. If you do not know how and where to create a temporary file, you can use a random number generator to get a temporary filename and the/tmp
directory to temporarily save it. - Make the necessary changes to
multipleMV.go
in order to print the files that are a match to the given regular expression without actually renaming them. - Try to create a regular expression that matches
PNG
files and use it to process the contents of a log file. - Create a regular expression that catches a date and a time string in order to print just the date part and delete the time part.