September 2017
Intermediate to advanced
466 pages
9h 33m
English
This section will present a Go program that converts tab characters to space characters in files and vice versa! This is the job that is usually done by a text editor, but it is good to know how to perform it on your own.
The code will be saved in tabSpace.go and will be presented in four parts.
In the current implementation, all the work is done with the help of regular expressions, pattern matching, and search and replace operations.
The first part is the expected preamble:
package main import ( "bufio" "fmt" "io" "os" "path/filepath" "strings" )
The second part contains the following ...
Read now
Unlock full access