September 2017
Intermediate to advanced
466 pages
9h 33m
English
This section will show how to implement a program that reads a log file that contains date and time information, in order to convert the time format found in each log entry. This operation might be needed when you have log files from different servers that are in several time zones, and you want to synchronize their times in order to create reports from their data or store them into a database to process them some other time.
The name of the presented program will be dateTimeLog.go, and it will be presented in four parts.
The first part is the following:
package main import ( "bufio" "flag" "fmt" "io" "os" "regexp" "strings" "time" )
The second part contains the following Go code:
func main() { flag.Parse() ...Read now
Unlock full access